{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/users/:user_id/devices","auth":"required","settings":"","results":{"codes":[{"name":"","code":"{\n  \"devices\": [\n    {\n      \"device_id\": \"5a4f622557ef69***8d54832\",\n      \"status\": 200\n    },\n    {\n      \"device_id\": \"36515d690fcf49c***302dda\",\n      \"status\": 200\n    }\n  ],\n  \"metadata\": {\n    success: 2,\n    failure: 0,\n    out_of_range: 0,\n    total: 2\n  }\n}","language":"json","status":200},{"name":"Multi-Status","code":"{\n  \"devices\": [\n    {\n      \"device_id\": \"5a4f622557ef69***8d54832\",\n      \"status\": 200\n    },\n    {\n      \"device_id\": \"36515d690fcf49c***302dda\",\n      \"status\": 404\n    },\n    ...\n    {\n      \"device_id\": \"2e6f2803c54baf5***a13f6b\",\n      \"status\": 416\n    }\n  ],\n  \"metadata\": {\n    success: 9,\n    failure: 1,\n    out_of_range: 1,\n    total: 11\n  }\n}","language":"json","status":"2XX"},{"code":"{\n  \"error\":\"unauthorized\"\n}","language":"json","status":401},{"code":"{\n  \"error\":\"your api client does not have the correct roles\"\n}","language":"json","status":403},{"code":"{\n  \"devices\": [\n    {\n      \"device_id\": \"5a4f622557ef69***8d54832\",\n      \"status\": 404\n    },\n    {\n      \"device_id\": \"36515d690fcf49c***302dda\",\n      \"status\": 404\n    }\n  ],\n  \"metadata\": {\n    success: 0,\n    failure: 2,\n    out_of_range: 0,\n    total: 2\n  }\n}","language":"json","status":422}]},"params":[{"name":"user_id","type":"string","default":"","desc":"The id of the user whose devices you wish to erase","required":false,"in":"path","ref":"","_id":"6080ddbe1ff6c4005c58a111"}],"examples":{"codes":[{"code":"curl -X POST -u :$API_KEY -H 'Accept: application/json' https://api.carnivalmobile.com/v6/users/$user_id/devices","language":"curl"}]},"method":"delete"},"next":{"description":"","pages":[]},"title":"Users / Devices","type":"endpoint","slug":"users-devices","excerpt":"","body":"This endpoint erases all devices belonging to a given user. Since this is a bulk operation, the total number of devices erased in one call is capped at 10. In addition if some erase operations fail this will be reflected in the return body. The caller may be required to call this endpoint more than once depending on the result (e.g. to erase 13 devices belonging to a user, two calls to this endpoint are required)\n[block:api-header]\n{\n  \"title\": \"Output format\"\n}\n[/block]\n* `devices`: an array of objects detailing the results of erasing each device belonging to the user. Each device object has the following fields:\n  * `device_id`: the identifier of the device being erased\n  * `status`: the result of this erase attempt. 200 for success, 4xx or 5xx for a failure. Failures are generally retryable. 416 status denotes a device outside the capped value of 10.\n* `metadata`: an object consisting of the following totals:\n  * `success`: the total number of erased devices\n  * `failure`: the total number of failures\n  * `out_of_scope`: the number of devices that were not attempted, due to being outside the cap value of 10\n  * `total`: the number of devices registered to the given user\n\n[block:api-header]\n{\n  \"title\": \"Return codes\"\n}\n[/block]\n* `200`: All devices belonging to the given user were erased\n* `207`: There was a mixture of failure and success while erasing devices\n* `401`: Unauthorized\n* `403`: Forbidden\n* `422`: Unable to erase any devices belonging to the given user","updates":[],"order":11,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"6080ddbe1ff6c4005c58a110","createdAt":"2021-04-22T02:21:50.695Z","user":"6080cea56ca069007e22d9c3","category":{"sync":{"isSync":false,"url":""},"pages":["5e6156bf5e4a51006dcd8138","55ed079b0d968e2100de8339","5e6156bf5e4a51006dcd8139","55ed0bb078319821005005cf","5e6156bf5e4a51006dcd813a","5e6156bf5e4a51006dcd813b","5e6156bf5e4a51006dcd813c","5e6156bf5e4a51006dcd813d","5e6156bf5e4a51006dcd813e","5e6156bf5e4a51006dcd813f","5e6156bf5e4a51006dcd8140","5e6156bf5e4a51006dcd8141","5e6156bf5e4a51006dcd8142","5e6156bf5e4a51006dcd8143","5e6156bf5e4a51006dcd8144","5e6156bf5e4a51006dcd8145","5b720760c44b7600034b79ce","5e6156bf5e4a51006dcd814d","5e6156bf5e4a51006dcd814e","5e6156bf5e4a51006dcd8156"],"title":"REST API","slug":"rest-api","order":5,"from_sync":false,"reference":true,"_id":"5e6156bf5e4a51006dcd8122","__v":20,"createdAt":"2015-09-02T04:30:21.948Z","project":"55e67aaa9cc7c62b00c4a1ea","version":"5e6156bf5e4a51006dcd818c"},"version":{"version":"1.5","version_clean":"1.5.0","codename":"ST Rebrand","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e6156bf5e4a51006dcd8120","5e6156bf5e4a51006dcd8121","5e6156bf5e4a51006dcd8122","5e6156bf5e4a51006dcd8123","5e6156bf5e4a51006dcd8124","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","5e6156bf5e4a51006dcd8125","5e6156bf5e4a51006dcd8126","5af0fe494ca2730003cbc98a","5af0fe55ec80af0003804ca2","5e69868cbd5dcb006b35867b","5e6986ca2c6652006791b6e8"],"_id":"5e6156bf5e4a51006dcd818c","project":"55e67aaa9cc7c62b00c4a1ea","__v":2,"forked_from":"5b720760c44b7600034b7a08","createdAt":"2015-09-02T04:27:23.612Z","releaseDate":"2015-09-02T04:27:23.612Z"},"project":"55e67aaa9cc7c62b00c4a1ea","__v":10,"parentDoc":null}

deleteUsers / Devices


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

user_id:
string
The id of the user whose devices you wish to erase

Examples


Result Format


Documentation

This endpoint erases all devices belonging to a given user. Since this is a bulk operation, the total number of devices erased in one call is capped at 10. In addition if some erase operations fail this will be reflected in the return body. The caller may be required to call this endpoint more than once depending on the result (e.g. to erase 13 devices belonging to a user, two calls to this endpoint are required) [block:api-header] { "title": "Output format" } [/block] * `devices`: an array of objects detailing the results of erasing each device belonging to the user. Each device object has the following fields: * `device_id`: the identifier of the device being erased * `status`: the result of this erase attempt. 200 for success, 4xx or 5xx for a failure. Failures are generally retryable. 416 status denotes a device outside the capped value of 10. * `metadata`: an object consisting of the following totals: * `success`: the total number of erased devices * `failure`: the total number of failures * `out_of_scope`: the number of devices that were not attempted, due to being outside the cap value of 10 * `total`: the number of devices registered to the given user [block:api-header] { "title": "Return codes" } [/block] * `200`: All devices belonging to the given user were erased * `207`: There was a mixture of failure and success while erasing devices * `401`: Unauthorized * `403`: Forbidden * `422`: Unable to erase any devices belonging to the given user

User Information

Try It Out

delete
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}