Create a new calendar booking
Create
| Parameter | Mandatory | Description | Examples | More Info |
|---|---|---|---|---|
| API | Yes | The API area | calendar.json | |
| General | Yes | Parameters described in overview | Authorization: Bearer <access_token> header — see Synergist API Authentication | Structure of an API call |
| Action | Yes | The action to perform | action=create | |
| Input | Yes | JSON string | See below |
| JSON Input | Mandatory | Description | Examples |
|---|---|---|---|
| calTimeSummaryInternal | Yes | "calTimeSummaryInternal":"1005543" | |
| calIsoDateTimeStart | Yes | "calIsoDateTimeStart":"2017-07-10T14:30:00" | |
| calIsoDateTimeEnd | Yes | "calIsoDateTimeEnd":"2017-07-10T14:30:00" | |
| calDurationDecimalHours | Yes | "calDurationDecimalHours":"-0.75" | |
| calResourceId | Yes | "calResourceId":"5" |
The duration passed may be modified by the business logic of the API. For example, if 500 hours is passed the API will reduce the duration to the hours for the number of working days specified by the start and end date. If no start or end time is specified in the ISO date fields, and the duration is for an entire day, the 'All day' flag on the booking will be automatically set.
Example request (OAuth 2.0):
Authorization: Bearer <access_token>
http://<SERVER>/jsonapi/calendar.json?&version=6&action=create&input={
"data": [
{
"calTimeSummaryInternal": "1005543",
"calIsoDateTimeStart": "2017-07-10T14:30:00",
"calIsoDateTimeEnd": "2017-07-10T14:30:00",
"calDurationDecimalHours": "-0.75",
"calResourceId": "5"
}
]
}
Example request (legacy username/password):
http://<SERVER>/jsonapi/calendar.json?&version=6&action=create&input={
"data": [
{
"calTimeSummaryInternal": "1005543",
"calIsoDateTimeStart": "2017-07-10T14:30:00",
"calIsoDateTimeEnd": "2017-07-10T14:30:00",
"calDurationDecimalHours": "-0.75",
"calResourceId": "5"
}
]
}&user=<username>&password=<password>
The end date does not need to be passed. A start date and the number of days can be specified instead. The calDurationDecimalHours would typically be the hours remaining on the estimate - it does not specify the number of hours for this booking. If no value is passed the system will create multiple bookings of the minimal duration as specified in system settings.
Authorization: Bearer <access_token>
http://<SERVER>/jsonapi/calendar.json?&version=6&action=create&input={
"data": [
{
"calTimeSummaryInternal": "1014302",
"calIsoDateTimeStart": "2020-05-05T14:30:00",
"calNumberOfDays": "10",
"calDurationDecimalHours": "200",
"calResourceId": "198"
}
]
}
Example request (legacy username/password):
http://<SERVER>/jsonapi/calendar.json?&version=6&action=create&input={
"data": [
{
"calTimeSummaryInternal": "1014302",
"calIsoDateTimeStart": "2020-05-05T14:30:00",
"calNumberOfDays": "10",
"calDurationDecimalHours": "200",
"calResourceId": "198"
}
]
}&user=<username>&password=<password>
If a start time is passed - as in this example the system will create multiple bookings each starting at the start time specified until the end of the day
Authorization: Bearer <access_token>
http://<SERVER>/jsonapi/calendar.json?&version=6&action=create&input={
"data": [
{
"calTimeSummaryInternal": "1014302",
"calIsoDateTimeStart": "2020-05-05T14:30:00",
"calNumberOfDays": "10",
"calDurationDecimalHours": "200",
"calResourceId": "198"
}
]
}
Example request (legacy username/password):
http://<SERVER>/jsonapi/calendar.json?&version=6&action=create&input={
"data": [
{
"calTimeSummaryInternal": "1014302",
"calIsoDateTimeStart": "2020-05-05T14:30:00",
"calNumberOfDays": "10",
"calDurationDecimalHours": "200",
"calResourceId": "198"
}
]
}&user=<username>&password=<password>
Example response:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"calUuid": "A3492EF45155B8438C2D13AA6F6030D2",
"calDiaryInternal": 56570,
"calResourceId": "34",
"calResourceName": "Freelancer.01",
"calTimeSummaryInternal": 1005543,
"calClientCode": "1/1DFHTEST",
"calClientName": "SnakeByte Software",
"calJobNumber": "1/00010481",
"calJobNumberSimple": "10481",
"calJobDescription1stLine": "No date dependencies test",
"calJobHandlerName": "David.Harvey",
"calJobAndPhase": "1/00010481.H01",
"calJobPhaseNumberSimple": "10481.H01",
"calPhaseDescription1stLine": "Design 2t",
"calStageCode": "",
"calTaskDescription": "",
"calChargeCode": "1/ALT",
"calChargeCodeDescription": "Amends New",
"calDescription": "",
"calNotes": "",
"calStatus": "",
"calRequestStatus": "",
"calStartDate": "2017-07-10",
"calStartTime": "14:30:00",
"calEndTime": "14:45:00",
"calIsoDateTimeStart": "2017-07-10T14:30:00",
"calIsoDateTimeEnd": "2017-07-10T14:45:00",
"calAllDay": false,
"calColourHex": "EBFF00",
"calFeedback": "TODO",
"calWeakLink": 6011,
"calendarunallocatedunique": "1/00010481.H01###1/ALT",
"calendarunallocatedestimated": 1,
"calendarunallocatedbooked": 3.25,
"calendarunallocatedremaining": -2.25,
"calendarunallocatedtimesheets": 0,
"calendarunallocateddraft": 0,
"calendarunallocatedinitials": "F0,FC",
"calNumberOfDays": "1",
"calDurationDescription": "0.25 hour",
"calHoursPerDay": "0.25",
"calTimeStampModified": 0,
"calRecordVersionNumber": 0
}
]
}