Download integrator.io Postman collection
State API endpoints
Relative URI | Method | Success Code | Description |
/state | GET | 200 | Get all global keys. |
/state/<key> | GET | 200 | Get the value associated with the key. |
/state/<key> | PUT | 200 | Create/update the value associated with the key. |
/state/<key> | DELETE | 204 | Delete the key and value. |
/state | DELETE | 204 | Delete all global keys and values. Be careful with this API! |
/<resource_type>/<_id>/state | GET | 200 | Get all keys stored underneath a specific resource in your account. |
/<resource_type>/<_id>/state/<key> | GET | 200 | Get the resource specific value associated with the key. |
/<resource_type>/<_id>/state/<key> | PUT | 200 | Create/update the resource specific value associated with the key. |
/{resource_type}/<_id>/state/<key> | DELETE | 200 | Delete the resource specific key and value. |
/{resource_type}/<_id>/state | DELETE | 200 | Delete all keys and values stored underneath the resource. Be careful with this API! |
State API examples
GET /v1/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "keys":[ "apple", "banana" ] }
GET /v1/state/banana HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "message":"Don't slip!" }
PUT /v1/state/banana HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
{ "message":"Don't slip!", "reply":"i didn't!" }
Sample Response:
OK
GET /v1/state/banana HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "message":"Don't slip!", "reply":"i didn't!" }
Note: This state value is stored underneath the related import resource.
PUT /v1/imports/55cca9d6f7dc37597700005d/state/sequenceNumber HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
{ "counter":1 }
Sample Response:
Created
GET /v1/imports/55cca9d6f7dc37597700005d/state/sequenceNumber HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "counter":1 }
Note: The key stored underneath the import (that we just created above) was not returned. Only global keys are returned by the top level GET /state API. To return all keys underneath a specific resource, use the more specific state API for that resource. For example, GET /imports/55cca9d6f7dc37597700005d/state
GET /v1/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "keys":[ "apple", "banana" ] }
GET /v1/imports/55cca9d6f7dc37597700005d/state HTTP/1.1
Host: api.integrator.io
Authorization: Bearer my_api_token
Sample Response:
{ "keys":[ "sequenceNumber" ] }
Comments
0 comments
Please sign in to leave a comment.