Update Thing State

This guide will show you how you can change your Thing state via API.

Change a Thing state

PUT https://console.monogoto.io/thing/ThingId_ICCID_{ICCID}/state/

Path Parameters

Name
Type
Description

ICCID*

String

The ICCID of your SIM

Headers

Name
Type
Description

TOKEN_HERE*

String

Your authentication token

Request Body

Name
Type
Description

THING_STATE*

String

Possible variables: ACTIVE / SUSPENDED

{
    // Response
}

Example using cURL:

curl -X PUT \
    --url "https://console.monogoto.io/thing/ThingId_ICCID_{ICCID}/state/" \
    -H "accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {TOKEN_HERE}" \
    -d "{ \"state\": \"{THING_STATE}\"}"

Expected response:

{
    Thing state updated successfully.
}

Please note that the above shown command needs to be replaced with information:

  • {ICCID} - replace with your Monogoto thing ICCID number

  • {TOKEN_HERE} - replace with your token

  • {THING_STATE} - replace with the state you wish your Thing to use:

    • ACTIVE - SIM card is activated and can be used

    • SUSPENDED - SIM card is suspended. Can not be used until status is changed to ACTIVE

Example of request setting Thing state to SUSPENDED:

curl -X PUT \
    --url "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\"}"

Last updated