Scheduled Events API
General:
Basics:
Base-URL: https://capi.lagerkoll.com/v1/events/
Parameters in the url should all be encoded and all data sent should be UTF-8
MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.
Headers:
There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>> user_id: <<USER_ID>> user_token: <<USER_TOKEN>> api_key: <<API_KEY>> Accept: application/json Content-Type: application/json
Errors:
Code | Description |
---|---|
900001 | Credentials don't match |
900101 | Common error |
900429 | Too many requests |
907001 | Error when getting scheduled events |
907002 | Error when creating a scheduled event |
907003 | Error when updating a scheduled event |
907004 | Error when removing a scheduled event |
{ "errorCode" : 900101, "errorMessage" : "Something went wrong on the server", "errorField" : null, "errorData" : null }
Scheduled Events API:
Scheduled Events
Get scheduled events
GETUrl:
Headers:
Accept: application/json or application/xml
Get a list of scheduled events for store
Body:
Successfull response:
{"events": [{ "actionType": "actionType", "createdBy": 4787, "action": {}, "createdName": "createdName", "id": 5306, "triggerType": "triggerType", "trigger": {} }]}
Get scheduled events for user
GETUrl: /user
Headers:
Accept: application/json or application/xml
Get a list of scheduled events for store and user
Body:
Successfull response:
{"events": [{ "actionType": "actionType", "createdBy": 9654, "action": {}, "createdName": "createdName", "id": 3995, "triggerType": "triggerType", "trigger": {} }]}
Add scheduled event
POSTUrl:
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Add a new scheduled event with a trigger and action
Body:
{ "actionType": "actionType", "action": {}, "triggerType": "triggerType", "trigger": {} }
Successfull response:
{ "actionType": "actionType", "createdBy": 8853, "action": {}, "createdName": "createdName", "id": 1386, "triggerType": "triggerType", "trigger": {} }
Remove scheduled event
DELETEUrl: /{id}
Headers:
Accept: application/json or application/xml
Remove a scheduled event for store
Body:
Successfull response:
Classes:
ScheduledEvent
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
id | long | R | |||||
triggerType | String | TIME, EVENT | R,W | ||||
trigger | HashMap | R,W | |||||
actionType | String | SEND_EMAIL, BEST_BEFORE_EMAIL, UNDELIVERED_ORDER_EMAIL | R,W | ||||
action | HashMap | R,W | |||||
createdBy | long | R | |||||
createdName | String | R |
ScheduledEventsResponse
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
events | List | R |