Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleResponse Code


HTTP Status code:Description/Response Body:
200 OKTransaction OK.
401 UnauthorizedAPITOKEN is invalid or null
{"error" : "APITOKEN is invalid or nullAUTH_REQUIRED"}
404 Not FoundNO_EVENT

no event found.

{"error" : "no event foundNO_EVENT"}



Code Block
titlecurl example
 curl -X GET -H "X-APITOKEN: API_TOKEN_HERE" -k https://m.thingscale.io/v2/event/EVENT_ID_HERE

...

Expand
titleResponse Code


HTTP Status code:Description/Response Body:
201 Create

Event Created.

{"event_id" : CREATED_EVENT_ID}

401 UnauthorizedAPITOKEN is invalid or null
{"error" : "APITOKEN is invalid or nullAUTH_REQUIRED"}
403 ForbiddenMAX_EVENT_REACH

Per account event limit reached.

{"error" : "max event count reachedMAX_EVENT_REACH"}




Code Block
titlecurl example
curl -X POST -H "X-APITOKEN: API_TOKEN_HERE" -k "https://m.thingscale.io/v2/event/"

...

Expand
titleResponse Code


HTTP Status code:Description/Response Body:
200 OKTransaction OK.
401 UnauthorizedAPITOKEN is invalid or null
{"error" : "APITOKEN is invalid or nullAUTH_REQUIRED"}
400 Bad Request

BAD_JSON_FORMAT

Bad Request.check JSON array

{"error" : "Bad Request.check JSON arrayBAD_JSON_FORMAT"}
403 ForbiddenNO_CHANNEL

changing mapped_ch failed.(Because channel_id is nothing)

{"error" : "no channel foundNO_CHANNEL"}
404 Not FoundNO_EVENT

Specified event_id is not found.

{"error" : "no event foundNO_EVENT"}



Code Block
titlecurl example
curl -X PUT -H "X-APITOKEN: API_TOKEN_HERE" -H "Content-Type: application/json" -k -d '{"mapped_ch" : 0,"description":"High Temp","notify_type":"email","post_url":"","enabled":"true","source":"value1","operator":">","threshold":24}' https://m.thingscale.io/v2/event/EVENT_ID_HERE

...

Expand
titleResponse Code


HTTP Status code:Description/Response:
200 OKTransaction OK.
401 UnauthorizedAPITOKEN is invalid or null
{"error" : "APITOKEN is invalid or nullAUTH_REQUIRED"}
403 ForbiddenEVENT_ENABLE

Specified event status is true.(Set enable=false before delete event.)

{"error" : "event is enabledEVENT_ENABLE"}
404 Not FoundNO_EVENT

Specified event_id is not found.

{"error" : "no event foundNO_EVENT"}
500 Internal Server ErrorOTHER_ERROR

Some internal error occured. please contact slalenics admin.

{"error" : "internal error occured"}


...