Create

Create a new calendar booking

ParameterMandatoryDescriptionExamplesMore Info
APIYesThe API areacalendar.json
GeneralYesParameters described in overviewuser=user&password=user&version=3.7v3.7 Overview
ActionYesThe action to performaction=create
InputYesJSON stringSee below
JSON InputMandatoryDescriptionExamples
calTimeSummaryInternalYes"calTimeSummaryInternal":"1005543"
calIsoDateTimeStartYes"calIsoDateTimeStart":"2017-07-10T14:30:00"
calIsoDateTimeEndYes"calIsoDateTimeEnd":"2017-07-10T14:30:00
calDurationDecimalHoursYes"calDurationDecimalHours":"-0.75"
calResourceIdYes"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:

http://<SERVER>/jsonapi/calendar.json?user=user&password=user&version=3.7&action=create&input={
  "data": [
    {
      "calTimeSummaryInternal": "1005543",
      "calIsoDateTimeStart": "2017-07-10T14:30:00",
      "calIsoDateTimeEnd": "2017-07-10T14:30:00",
      "calDurationDecimalHours": "-0.75",
      "calResourceId": "5"
    }
  ]
}

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.

http://192.168.0.239/jsonapi/calendar.json?user=user&password=user&version=3.7&action=create&input={
  "data": [
    {
      "calTimeSummaryInternal": "1014302",
      "calIsoDateTimeStart": "2020-05-05T14:30:00",
      "calNumberOfDays": "10",
      "calDurationDecimalHours": "200",
      "calResourceId": "198"
    }
  ]
}

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

http://192.168.0.239/jsonapi/calendar.json?user=user&password=user&version=3.7&action=create&input={
  "data": [
    {
      "calTimeSummaryInternal": "1014302",
      "calIsoDateTimeStart": "2020-05-05T14:30:00",
      "calNumberOfDays": "10",
      "calDurationDecimalHours": "200",
      "calResourceId": "198"
    }
  ]
}

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
    }
  ]
}