The /events
resource provides complete control over events and allows retrieving, updating, adding, and deleting events.
Listing All Events
Request
GET /events/
Example Response
// GET /events/
{
"123456": {
"id": 123456,
"caption": "v1 Approved",
"date": "2016-07-15T14:08:41",
"origin": "User",
"details": null,
"products": [
"300400"
]
},
"123457": {
"id": 123457,
"caption": "v2 Approved",
"date": "2016-09-15T14:07:28",
"origin": "User",
"details": "V2 approved on this day. Info: [https://mysite.com/relevant/link]"
"products": [
"300400"
]
}
}
Creating an Event
Request
POST /events/
Arguments
Argument |
Type |
Description |
caption |
String |
The caption of the event |
date |
Date |
(yyyy-mm-dd) date for the event |
details |
String |
Notes & details about the event. |
products |
List |
An array of product ids or an array containing the string ‘all’ |
Example Request
// POST /events/
{
"caption":"Ad Campaign",
"date":"2016-12-21",
"products":[
"all" // or 23433, 34343 etc.
]
}
Example Response
// POST /events/
{
"id": 28961,
"caption": "Ad Campaign",
"date": "2016-12-21T00:00:00",
"origin": "API",
"details": "Better on Paper",
"products": [
"all"
]
}
Updating an Event
Request
PUT /events/{event_id}
Arguments
Argument |
Type |
Description |
caption |
String |
The caption of the event |
date |
Date |
(yyyy-mm-dd) date for the event |
details |
String |
Notes & details about the event. |
products |
List |
An array of product ids or an array containing the string ‘all’ |
Example Response
// PUT /events/5438
{
"id": 543812,
"account_id": 32109,
"caption": "Changed Category",
"date": "2017-04-12T00:00:00",
"origin": "User",
"products": [
"300400"
]
}
Deleting an Event
Request
DELETE /events/{event_id}
Arguments
Argument |
Type |
Description |
eventId |
String |
The ID of the event to delete |
Example Response
// DELETE /events/5438
// HTTP 204