Agregadores y PSPaaS
Gestión de Usuarios
Sesiones
2 min
aqui se describe cómo gestionar las sesiones de los usuarios { "name" "obtener sesiones de un usuario", "method" "get", "url" "https //{suga id} sugaway io/p/user/\ uid/session", "description" "este endpoint permite obtener las sesiones activas de un usuario", "tab" "examples", "examples" { "languages" \[ { "id" "mccdn9xclxes4 huev01x", "language" "curl", "code" "curl location globoff 'https //{suga id} sugaway io/p/operator/user' \\\\\n header 'accept application/json' \\\\\n header 'content type application/json' \\\\\n data '{\\"name\\" \\"string\\",\\"email\\" \\"string\\",\\"phone\\" \\"string\\",\\"identification\\" \\"string\\"}'", "customlabel" "" }, { "id" "zc4ntftsgez7oziwfhydm", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //{suga id} sugaway io/p/operator/user',\n 'headers' {\n 'accept' 'application/json',\n 'content type' 'application/json'\n },\n body json stringify({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n })\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "7stzogfjeo2guchdgtj1k", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"content type\\", \\"application/json\\");\n\nvar raw = json stringify({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n});\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //{suga id} sugaway io/p/operator/user\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "szyrbcc8ceajop9lm7elm", "language" "python", "code" "import requests\nimport json\n\nurl = \\"https //{suga id} sugaway io/p/operator/user\\"\n\npayload = json dumps({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n})\nheaders = {\n 'accept' 'application/json',\n 'content type' 'application/json'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "c3s730h2 hl4vjbjiwl89", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"json\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //{suga id} sugaway io/p/operator/user\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"content type\\"] = \\"application/json\\"\nrequest body = json dump({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n})\n\nresponse = https request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "mccdn9xclxes4 huev01x" }, "results" { "languages" \[ { "id" "oe 7xa5i41at12jl11t9l", "language" "200", "customlabel" "", "code" "{\n \\"name\\" \\"cake's name\\",\n }" }, { "id" "dbqsb 6mmkatc7dkkrd1d", "language" "404", "customlabel" "", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n }" } ], "selectedlanguageid" "oe 7xa5i41at12jl11t9l" }, "request" { "pathparameters" \[ { "name" "uid", "kind" "optional", "type" "string", "description" "uid del usuario", "children" \[] } ], "queryparameters" \[], "headerparameters" \[ { "name" "x api key", "kind" "optional", "type" "string", "description" "api key del operador", "children" \[] }, { "name" "x access token", "kind" "optional", "type" "string", "description" "access token del operador", "children" \[] } ], "bodydataparameters" \[], "formdataparameters" \[] }, "currentnewparameter" { "label" "path parameter", "value" "pathparameters" } } { "name" "eliminar sesión de un usuario", "method" "delete", "url" "https //{suga id} sugaway io/p/user/\ uid/session/\ sid/action/terminate", "description" "este endpoint permite eliminar una sesión activa de un usuario", "tab" "examples", "examples" { "languages" \[ { "id" "mccdn9xclxes4 huev01x", "language" "curl", "code" "curl location globoff 'https //{suga id} sugaway io/p/operator/user' \\\\\n header 'accept application/json' \\\\\n header 'content type application/json' \\\\\n data '{\\"name\\" \\"string\\",\\"email\\" \\"string\\",\\"phone\\" \\"string\\",\\"identification\\" \\"string\\"}'", "customlabel" "" }, { "id" "zc4ntftsgez7oziwfhydm", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //{suga id} sugaway io/p/operator/user',\n 'headers' {\n 'accept' 'application/json',\n 'content type' 'application/json'\n },\n body json stringify({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n })\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "7stzogfjeo2guchdgtj1k", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"content type\\", \\"application/json\\");\n\nvar raw = json stringify({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n});\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //{suga id} sugaway io/p/operator/user\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "szyrbcc8ceajop9lm7elm", "language" "python", "code" "import requests\nimport json\n\nurl = \\"https //{suga id} sugaway io/p/operator/user\\"\n\npayload = json dumps({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n})\nheaders = {\n 'accept' 'application/json',\n 'content type' 'application/json'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "c3s730h2 hl4vjbjiwl89", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"json\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //{suga id} sugaway io/p/operator/user\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"content type\\"] = \\"application/json\\"\nrequest body = json dump({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n})\n\nresponse = https request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "mccdn9xclxes4 huev01x" }, "results" { "languages" \[ { "id" "oe 7xa5i41at12jl11t9l", "language" "200", "customlabel" "", "code" "{\n \\"name\\" \\"cake's name\\",\n }" }, { "id" "dbqsb 6mmkatc7dkkrd1d", "language" "404", "customlabel" "", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n }" } ], "selectedlanguageid" "oe 7xa5i41at12jl11t9l" }, "request" { "pathparameters" \[ { "name" "uid", "kind" "optional", "type" "string", "description" "uid del usuario", "children" \[] }, { "name" "sid", "kind" "optional", "type" "string", "description" "uid de la sesión", "children" \[] } ], "queryparameters" \[], "headerparameters" \[ { "name" "x api key", "kind" "optional", "type" "string", "description" "api key del operador", "children" \[] }, { "name" "x access token", "kind" "optional", "type" "string", "description" "access token del operador", "children" \[] } ], "bodydataparameters" \[], "formdataparameters" \[] }, "currentnewparameter" { "label" "path parameter", "value" "pathparameters" } } { "name" "eliminar sesiones activas de un usuario", "method" "delete", "url" "https //{suga id} sugaway io/p/user/\ uid/session/action/terminate", "description" "este endpoint permite eliminar todas las sesiones activas de un usuario", "tab" "examples", "examples" { "languages" \[ { "id" "mccdn9xclxes4 huev01x", "language" "curl", "code" "curl location globoff 'https //{suga id} sugaway io/p/operator/user' \\\\\n header 'accept application/json' \\\\\n header 'content type application/json' \\\\\n data '{\\"name\\" \\"string\\",\\"email\\" \\"string\\",\\"phone\\" \\"string\\",\\"identification\\" \\"string\\"}'", "customlabel" "" }, { "id" "zc4ntftsgez7oziwfhydm", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //{suga id} sugaway io/p/operator/user',\n 'headers' {\n 'accept' 'application/json',\n 'content type' 'application/json'\n },\n body json stringify({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n })\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "7stzogfjeo2guchdgtj1k", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"content type\\", \\"application/json\\");\n\nvar raw = json stringify({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n});\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //{suga id} sugaway io/p/operator/user\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "szyrbcc8ceajop9lm7elm", "language" "python", "code" "import requests\nimport json\n\nurl = \\"https //{suga id} sugaway io/p/operator/user\\"\n\npayload = json dumps({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n})\nheaders = {\n 'accept' 'application/json',\n 'content type' 'application/json'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "c3s730h2 hl4vjbjiwl89", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"json\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //{suga id} sugaway io/p/operator/user\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"content type\\"] = \\"application/json\\"\nrequest body = json dump({\n \\"name\\" \\"string\\",\n \\"email\\" \\"string\\",\n \\"phone\\" \\"string\\",\n \\"identification\\" \\"string\\"\n})\n\nresponse = https request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "mccdn9xclxes4 huev01x" }, "results" { "languages" \[ { "id" "oe 7xa5i41at12jl11t9l", "language" "200", "customlabel" "", "code" "{\n \\"name\\" \\"cake's name\\",\n }" }, { "id" "dbqsb 6mmkatc7dkkrd1d", "language" "404", "customlabel" "", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n }" } ], "selectedlanguageid" "oe 7xa5i41at12jl11t9l" }, "request" { "pathparameters" \[ { "name" "uid", "kind" "optional", "type" "string", "description" "uid del usuario", "children" \[] } ], "queryparameters" \[], "headerparameters" \[ { "name" "x api key", "kind" "optional", "type" "string", "description" "api key del operador", "children" \[] }, { "name" "x access token", "kind" "optional", "type" "string", "description" "access token del operador", "children" \[] } ], "bodydataparameters" \[], "formdataparameters" \[] }, "currentnewparameter" { "label" "path parameter", "value" "pathparameters" } }