Integration of data on Tekon IoT Platform by REST API - Status codes
For each request, the server processes the information and returns an appropriate answer to the result of the request. With the integration of data on the Tekon IoT Platform by REST API, the possible answers from the server differ as follows:
• 201 - Resource created successfully (Created);
• 400 - Client error (Bad Request);
• 500 - Server error (Internal server error);
The status code 201 informs the client that the request has been successfully accepted. In this context, this answer indicates that the data were inserted into the database and allocated on the Tekon IoT Platform datasource.
Example of an answer of success:
{
"idDataSource": 4,
"idData": "fca38d5d-7898-4576-bd2b-c35dbe8260e4"
}
Responses returned with status code 400 indicate an error in the parameters of the request sent to the server. The most common cases that can give rise to this type of response are the use of invalid API keys or requests without variables information.
Example of an error response, where the user's API key is not valid:
{
"userApiKey": [
"Invalid key."
]
}
Status code 500 errors represent internal errors in the API. This type of response is never caused by any non-conformity in the request from the client side. It is common for the client to repeat the request whenever faced with this response.
Note: if the problem persists, contact Tekon Electronics technical support and provide as much information as possible to help solve the problem.