How to Change Thing State?
This guide will show you how you can change your Thing state via API.
To change a Thing state, please use following request:
1
curl -X PUT "https://console.monogoto.io/thing/ThingId_ICCID_<<<_THING_ICCID_>>>/state/" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer <<<_TOKEN_HERE_>>>" -d "{ \"state\": \"<<<_THING_STATE_>>>\"}"
Copied!
Please note that the above shown command needs to be replaced with information: <<<_THING_ICCID_>>> - replace with your Monogoto thing ICCID number <<<_TOKEN_HERE_>>> - replace with your token. You may obtain Token, by running Login Token API command. <<<_THING_STATE_>>> - replace with the state you wish your Thing to use (ACTIVE or SUSPENDED) ACTIVE - SIM card is activated and can be used. SUSPENDED - SIM card is suspended. Can not be used until status is changed to ACTIVE. If needed this API can be tested and used in the Monogoto portal following this path: Thing PUT/thing/{ThingId}/state
Example of request setting Thing state to SUSPENDED:
1
curl -X PUT "https://console.monogoto.io/thing/ThingId_ICCID_8912372646888991/state/" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer eyJhb6IkpXVCJ9.eyJSb2xlIjoiVXN4lclByb2ZpbGVJZF9kZGM2MThhNC0wNTI1LTQ2MmUtYWN3NzhhMGQxYmbSI6Im4zgFkbWluIiwiQ3VzdG9tsbCwiVXNlcklkIjoiVklkXzg5Yj5Y2OGEyUtNDQThhLTEzZjA0MzJhZDE3YyINTAzgZmUtZGI51My00ZjRiLTktN2U5Yjc0ZWU1ZThlIiwiaWNzM3MjI5L2MDY3NTE2Mjl9.99aSLzP7kTgK6TZGW-xalrMu0GkW6viunt3XxbNng" -d "{ \"state\": \"SUSPENDED\"}"
Copied!
Expected result:
1
Thing state updated successfully.
Copied!
Last modified 2mo ago
Copy link