NODES API
Smolar nodes API was created to make sychronization with our website https://www.smolar.pl/ much easier. Thanks to this, you can be always connected to our latest news without entering our website – API & automatic tasks will do the job.
API URL
https://api.smolar.pl/
REQUEST METHOD
POST
AUTHORIZATION
BEARER TOKEN*
AVAILABLE PUBLIC METHODS
- getNode - method returning news – single or multiple
- deletedNodes – method returning deleted news (in case of local db updates)
DATA PARAMS
getNode:
- request_type:
< single | multiple > - nid:
< node_id > - only case single - timestamp:
< 0 | timestamp_value > - only case multiple
Sample request objects:
deletedNodes:
- timestamp:
< 0 | timestamp_value > - timestamp value bigger than 0 will return only nid's of deleted nodes since exact time
Sample request object:
SUCCESS RESPONSES
getNode:
- HTTP Code 200
- List of nodes and its content (case single will return only one node in array)
Sample response object:
deletedNodes:
- HTTP Code 200
- List of nid's (node_id's) of deleted nodes since time specified in request
Sample response object:
ERROR RESPONSES
In error case API will response error HTTP code and error object containing error code and error short description
- HTTP Code 4xx/5xx
- Response error object with error code & description params
Sample response object:
List of all API responses in table below.
| HTTP Response Code | Message | Error Code | Reason/Action info |
|---|---|---|---|
| 200 | [nodes_array] or [deleted_nodes_id_array] | n/a | Request received correctly, matching nodes were returned |
| 406 | key values empty | 1 | One or more key values (eg. request_type) is missing |
| 406 | wrong request type | 2 | Request type is incorrect |
| 406 | wrong timestamp | 2 | Timestamp is not a correct value |
| 401 | wrong bearer token | 3 | Authorization token is wrong |
| 400 | no request | 4 | No request sent |
| 400 | no post | 5 | POST array not found |
| 404 | node not found | 6 | Node with requested ID was not found or is not available |