Create Folder
/folders
Create Folder [POST]
Create a new folder.
Authorization: Admin, Web, Mobile
Request
Body{
"num": null,
"description": "Facility Checks",
"folderTypeId": 230,
"accountId": 1001,
"locationId": 108,
"schedules": [
{
"userId": 2228,
"scheduleFrom": "2015-08-08T08:30:00Z",
"scheduleTo": "2015-08-08T09:30:00Z",
"note": "show ID at entrance"
}
]
//--optional payload include for creating a series--
"series:"
{
"repeat": 2,
"repeatEvery": 5,
"repeatBy": 1, // optionally include 0/1 for DoW/DoM on monthly
"startDate": '2016-01-01',
"endDate": '2016-02-05',
"description": "",
"userIds": [1000,1001],
"scheduledFor": 1
}
}
Series Attributes
| Attribute | Type | Description |
|---|---|---|
| createSeries |
bool | including true here ignores the 'schedules' payload and lets the API know to validate the series attributes sent in the request |
| repeat |
int | corresponds to the Frequency object (Daily = 1, Weekly = 2, Monthly = 3) |
| repeatEvery |
int | repeat every X days/weeks/months (1-30) |
| repeatBy |
int | when "Monthly" frequency chosen 0 means repeat by day of the month (for example the 2nd of every month), 1 means repeat by day of week (for example every 2nd Wednesday of every month) |
| startDate | datetime | The first day of the series |
| endDate | datetime | The date that the series ends by (not necessarily ends on) |
| description | string | The description will be placed on each folder in the series |
| userIds | array[int] | The userIds that the series schedules should be scheduled to. |
| scheduledFor |
int | The number of days the schedules duration should be. For example schedule monthly for 6 months with each schedules duration being 2 days |
Response 200
Body
{
"item": {
"id": 32988,
"num": FC908,
"description": "Facility Checks",
"folderType": {
"id" :230,
"name": "Quotes",
"color": "9ff79f",
"rowStatus": 1
},
"createdAt": "2015-08-08T08:30:00Z",
"createdBy": {
"id": 1000,
"firstName": "Homer",
"lastName": "Simpson"
},
"closed": false,
"closedAt": null,
"closedBy": null,
"account": {
"id": 6293,
"name": "Alpha and Omega",
"accountNum": "AX89174"
},
"location": {
"id": 108,
"name": "1st Branch"
},
"schedules": [
{
"userId": 2228,
"scheduleFrom": "2015-08-08T08:30:00Z",
"scheduleTo": "2015-08-08T09:30:00Z",
"note": "show ID at entrance"
}
]
}
}
Response 422
Body
{
"errors": {
"folderTypeId": [
"Folder Type is required."
],
"accountId": [
"Account is required."
]
}
}
or...
{
"errors": {
"schedules[0].userId": [
"User is required."
],
"schedules[0].scheduleFrom": [
"Start time is required."
]
}
}
or...
{
"errors": {
"schedules[0].scheduleFrom": [
"Must be on or before 8/19/2015."
]
}
}