{"_id":"5578af9327f77c0d00fe62ce","user":"5564f227f0f70f0d00a9ab20","version":{"_id":"55650b9eb893840d00444701","project":"55650b9eb893840d004446fe","__v":2,"createdAt":"2015-05-27T00:11:10.647Z","releaseDate":"2015-05-27T00:11:10.647Z","categories":["55650b9fb893840d00444702","5566a1557acd550d0075e894"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":4,"category":{"_id":"55650b9fb893840d00444702","version":"55650b9eb893840d00444701","pages":["55650b9fb893840d00444704","55662e121ec2311900e4c538","55663058f579050d00c3d42d","556633b61ec2311900e4c544","55663419f579050d00c3d43f","55663490979a3c2500bbafa6","5566352a979a3c2500bbafa8","55663578979a3c2500bbafab","556635fd1ec2311900e4c551","5566365a979a3c2500bbafb3","556636daf579050d00c3d448","5568d269c87afd2500e5254c","556b5b46ab693b1900ce1722","556bbee230922f1700ad5e22","5578af9327f77c0d00fe62ce","567328a458c4890d00bb545f"],"project":"55650b9eb893840d004446fe","__v":16,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-27T00:11:11.144Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"project":"55650b9eb893840d004446fe","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-10T21:43:47.695Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":10,"body":"[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/devices/{uuid}/tokens\"\n}\n[/block]\nCreate a new session token\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Tokens Array\",\n  \"body\": \"This will add a new token to the ```tokens``` array in your Meshblu device.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X POST \\\\\\n  --header \\\"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\\\" \\\\\\n  --header \\\"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\\\" \\\\\\n  https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n## Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"uuid\\\":\\\"c9eeca22-fc0f-4081-b430-bd5b67091106\\\",\\n  \\\"token\\\":\\\"167728cb25a449b39809ca2d82318703002d3628\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"delete\",\n  \"title\": \"/devices/{uuid}/tokens/{token}\"\n}\n[/block]\nRemove a new session token\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Remove Token\",\n  \"body\": \"This will invalidate your previous token and any connection using the token will be disconnected immediately.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X DELETE \\\\\\n  --header \\\"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\\\" \\\\\\n  --header \\\"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\\\" \\\\\\n  https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens/077b6ec9c9dff30869d279aee1fc2a4f776181e9\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"session-tokens","type":"basic","title":"Session Tokens"}
[block:api-header] { "type": "post", "title": "/devices/{uuid}/tokens" } [/block] Create a new session token [block:callout] { "type": "info", "title": "Tokens Array", "body": "This will add a new token to the ```tokens``` array in your Meshblu device." } [/block] [block:code] { "codes": [ { "code": "curl -X POST \\\n --header \"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\" \\\n --header \"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\" \\\n https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens", "language": "shell" } ] } [/block] ## Response [block:code] { "codes": [ { "code": "{\n \"uuid\":\"c9eeca22-fc0f-4081-b430-bd5b67091106\",\n \"token\":\"167728cb25a449b39809ca2d82318703002d3628\"\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "delete", "title": "/devices/{uuid}/tokens/{token}" } [/block] Remove a new session token [block:callout] { "type": "danger", "title": "Remove Token", "body": "This will invalidate your previous token and any connection using the token will be disconnected immediately." } [/block] [block:code] { "codes": [ { "code": "curl -X DELETE \\\n --header \"meshblu_auth_uuid: c9eeca22-fc0f-4081-b430-bd5b67091106\" \\\n --header \"meshblu_auth_token: 077b6ec9c9dff30869d279aee1fc2a4f776181e9\" \\\n https://meshblu.octoblu.com/devices/c9eeca22-fc0f-4081-b430-bd5b67091106/tokens/077b6ec9c9dff30869d279aee1fc2a4f776181e9", "language": "shell" } ] } [/block]