api:pbx:calendar:create
Table of Contents
API : PBX : Calendar Create
Request
This request will create a new calendar event in the users personal calendar.
Calendar events are personal, but other employees can be given writeCalendar permissions through PBX groups.
| URL | https://api.telecomx.dk/pbx/calendar | ||
|---|---|---|---|
| Method | POST | ||
| Access level | PERSONAL if event belongs to the user. VIEWER, MANAGER, OWNER if event belongs to the user or user has group right 'writeCalendar' on the employee. RESELLER, RESELLER_ADMIN or ADMIN no access. |
||
| Body | customer | Id | Id of the customer the event belongs to, defaults to users customer. |
| employee | Id | Id of the employee the event belongs to, defaults to the employee self. | |
| subject | String | Subject. | |
| body | Object | Body. | |
| body.content | String | Body content. | |
| body.type | String | Type of body: html or text. | |
| body.preview | String | Textual preview of the body. | |
| start | Date | Start | |
| end | Date | End | |
| isAllDay | Boolean | True if event is all day. | |
| importance | String | Event importance: low, normal, high | |
| type | String | Type of event: singleInstance (default) - single event, occurrence - occurrence of a series, exception - exception from a series, seriesMaster - recurring series of events. |
|
| seriesMasterId | String | Id of the series master. Only applies for types occurrence and exception. | |
| showAs | String | State of employee during event: unknown, free, tentative, busy, oof, workingElsewhere. | |
| sensitivity | String | Sensitivity: normal - all may view, personal - marked as non-work, private - non-work visible to owner only, confidential - work, visible to owner only. | |
| isCancelled | Boolean | True if cancelled. | |
| isOnlineMeeting | Boolean | True if this is an online meeting. | |
| onlineMeetingJoinUrl | String | If this is an online meeting (teams) this is the url to join the meeting. | |
| isOrganizer | Boolean | True if employee has created this event. | |
| isReminderOn | Boolean | True if a reminder for this event is enabled. | |
| reminderMinutesBeforeStart | Number | Number of minutes to be reminded before start. | |
| location | Object | Location data. | |
| location.displayName | String | Optional name of location. | |
| location.emailAddress | String | Optional email address of the location. | |
| location.address | Object | Optional address of the location. | |
| location.address.street | String | Street. | |
| location.address.zip | String | Zip. | |
| location.address.city | String | City. | |
| location.address.state | String | State. | |
| location.address.country | String | Country. | |
| recurrence | Object | Recurrence settings - null if not used | |
| recurrence.pattern | Object | Recurrence pattern | |
| recurrence.pattern.dayOfMonth | Number | day of month the event occurs or null, if type=absoluteMonthly,absoluteYearly. | |
| recurrence.pattern.daysOfWeek | Array | Days of the week the event occurs or null: sunday, monday, tuesday, wednesday, thursday, friday, saturday, if type=weekly,relativeMonthly,relativeYearly. | |
| recurrence.pattern.firstDayOfWeek | String | First day of week, if type=weekly. | |
| recurrence.pattern.index | String | which instance of allow days in daysOfWeek, counted from start of month to invoke: first, second, third, fourth, last, if type=relativeMonthly,relativeYearly. | |
| recurrence.pattern.interval | Number | The number of units between occurrences, where units can be in days, weeks, months, or years, depending on the type. | |
| recurrence.pattern.month | Number | The month in which the event occurs. This is a number from 1 to 12. | |
| recurrence.pattern.type | String | daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. | |
| recurrence.range | Object | Recurrence range | |
| recurrence.range.endDate | Date | Last date it may occur. | |
| recurrence.range.numberOfOccurrences | Number | Number of occurrences, if range-type=numbered. | |
| recurrence.range.startDate | Date | Must be same as start of master event. | |
| recurrence.range.type | String | endDate, noEnd, numbered. | |
| attendees | Array | List of attendees - empty of no other parties will attend | |
| attendees[].type | String | required, optional, resource. | |
| attendees[].emailAddress | String | email address. | |
| attendees[].name | String | Name of attendee. | |
| attendees[].statusResponse | String | Status response: none, organizer, tentativelyAccepted, accepted, declined, notResponded. | |
| attendees[].statusTime | Date | When attendee responded. | |
| statusResponse | String | [Optional] Users response to an invite for this event: none, organizer, tentativelyAccepted, accepted, declined, notResponded. |
|
| statusTime | Date | [Optional] When user responded to the invite. |
|
| categories | Array | [Optional] list of names of categories the event is tagged with. |
|
Most properties ar optional, as little as a subject, start and end should suffice.
Request body example
{ "_id":"12345678901234567890ABCD", "externalId": "MS365-sfhu3hfnbjob3u09ihfionbuoeh0hcnonboeunonsc", "customer": "12345678901234567890AAAA", "employee": "12345678901234567890BBBB", "subject": "My event", "body": { "content": "<b>this</b> is the message body", "type": "HTML", "preview": "this is the message body" }, "start": "2024-01-01T00:00:00.000Z", "end": "2024-01-01T01:00:00.000Z", "isAllDay": false, "importance": "normal", "type": "singleInstance", "seriesMasterId": null, "showAs": "busy", "sensitivity": "normal", "isCancelled": false, "isOnlineMeeting": false, "isOrganizer": true, "isReminderOn": true, "reminderMinutesBeforeStart": 15, "created": "2024-01-01T00:00:00.000Z", "lastModified": "2024-01-01T00:00:00.000Z", "location": { "displayName": "Restaurant Beef", "emailAddress": "location@mail.com", "address": { "street": "Main street 24", "zip": "1234", "city": "Copenhagen", "state": null, "country": "Danmark" } }, "recurrence": { "pattern": { "dayOfMonth": null, "daysOfWeek": [ "monday","tuesday" ], "firstDayOfWeek": "monday", "index": "first", "interval": 2, "month": null, "type": "absoluteMonthly" }, "range": { "endDate": "2024-06-01T00:00:00.000Z", "numberOfOccurrences": null, "startDate": "2024-01-01T00:00:00.000Z", "type": "endDate" } }, "attendees": [ { "type": "required", "emailAddress": "user1@telecomx.dk", "name": "User 1", "statusResponse": "accepted", "statusTime": "2024-01-01T00:00:00.000Z" }, { "type": "required", "emailAddress": "user2@telecomx.dk", "name": "User 2", "statusResponse": "declined", "statusTime": "2024-01-01T00:02:00.000Z" } ], "statusResponse": "accepted", "statusTime": "2024-01-01T00:00:00.000Z", "categories": [ "Internal meeting", "Coffee", "Buns" ] }
Response
The response will be the newly created contact, if no errors occurred.
| JSON object | ||
|---|---|---|
| _id | Id | Unique id of the calendar event. |
| externalId | String | External ID, can be used to reference events from another system. |
| customer | Id | Id of the customer. |
| employee | Id | Id of the employee the event belongs to. |
| subject | String | Subject. |
| body | Object | Body. |
| body.content | String | Body content. |
| body.type | String | Type of body: html or text. |
| body.preview | String | Textual preview of the body. |
| start | Date | Start |
| end | Date | End |
| isAllDay | Boolean | True if event is all day. |
| importance | String | Event importance: low, normal, high |
| type | String | Type of event: singleInstance - single event, occurrence - occurrence of a series, exception - exception from a series, seriesMaster - recurring series of events. |
| seriesMasterId | String | Id of the series master. Only applies for types occurrence and exception. |
| showAs | String | State of employee during event: unknown, free, tentative, busy, oof, workingElsewhere. |
| sensitivity | String | Sensitivity: normal - all may view, personal - marked as non-work, private - non-work visible to owner only, confidential - work, visible to owner only. |
| isCancelled | Boolean | True if cancelled. |
| isOnlineMeeting | Boolean | True if this is an online meeting. |
| onlineMeetingJoinUrl | String | If this is an online meeting (teams) this is the url to join the meeting. |
| isOrganizer | Boolean | True if employee has created this event. |
| isReminderOn | Boolean | True if a reminder for this event is enabled. |
| reminderMinutesBeforeStart | Number | Number of minutes to be reminded before start. |
| created | Date | When it was created. |
| lastModified | Date | When it was last modified. |
| location | Object | Location data. |
| location.displayName | String | Optional name of location. |
| location.emailAddress | String | Optional email address of the location. |
| location.address | Object | Optional address of the location. |
| location.address.street | String | Street. |
| location.address.zip | String | Zip. |
| location.address.city | String | City. |
| location.address.state | String | State. |
| location.address.country | String | Country. |
| recurrence | Object | Recurrence settings |
| recurrence.pattern | Object | Recurrence pattern |
| recurrence.pattern.dayOfMonth | Number | day of month the event occurs or null, if type=absoluteMonthly,absoluteYearly. |
| recurrence.pattern.daysOfWeek | Array | Days of the week the event occurs or null: sunday, monday, tuesday, wednesday, thursday, friday, saturday, if type=weekly,relativeMonthly,relativeYearly. |
| recurrence.pattern.firstDayOfWeek | String | First day of week, if type=weekly. |
| recurrence.pattern.index | String | which instance of allow days in daysOfWeek, counted from start of month to invoke: first, second, third, fourth, last, if type=relativeMonthly,relativeYearly. |
| recurrence.pattern.interval | Number | The number of units between occurrences, where units can be in days, weeks, months, or years, depending on the type. |
| recurrence.pattern.month | Number | The month in which the event occurs. This is a number from 1 to 12. |
| recurrence.pattern.type | String | daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. |
| recurrence.range | Object | Recurrence range |
| recurrence.range.endDate | Date | Last date it may occur. |
| recurrence.range.numberOfOccurrences | Number | Number of occurrences, if range-type=numbered. |
| recurrence.range.startDate | Date | Must be same as start of master event. |
| recurrence.range.type | String | endDate, noEnd, numbered. |
| attendees | Array | List of attendees |
| attendees[].type | String | required, optional, resource. |
| attendees[].emailAddress | String | email address. |
| attendees[].name | String | Name of attendee. |
| attendees[].statusResponse | String | Status response: none, organizer, tentativelyAccepted, accepted, declined, notResponded. |
| attendees[].statusTime | Date | When attendee responded. |
| statusResponse | String | Users response to an invite for this event: none, organizer, tentativelyAccepted, accepted, declined, notResponded. |
| statusTime | Date | When user responded to the invite. |
| categories | Array | Optional list of names of categories the event is tagged with. |
Example
{ "_id":"12345678901234567890ABCD", "externalId": "MS365-sfhu3hfnbjob3u09ihfionbuoeh0hcnonboeunonsc", "customer": "12345678901234567890AAAA", "employee": "12345678901234567890BBBB", "subject": "My event", "body": { "content": "<b>this</b> is the message body", "type": "HTML", "preview": "this is the message body" }, "start": "2024-01-01T00:00:00.000Z", "end": "2024-01-01T01:00:00.000Z", "isAllDay": false, "importance": "normal", "type": "singleInstance", "seriesMasterId": null, "showAs": "busy", "sensitivity": "normal", "isCancelled": false, "isOnlineMeeting": false, "isOrganizer": true, "isReminderOn": true, "reminderMinutesBeforeStart": 15, "created": "2024-01-01T00:00:00.000Z", "lastModified": "2024-01-01T00:00:00.000Z", "location": { "displayName": "Restaurant Beef", "emailAddress": "location@mail.com", "address": { "street": "Main street 24", "zip": "1234", "city": "Copenhagen", "state": null, "country": "Danmark" } }, "recurrence": { "pattern": { "dayOfMonth": null, "daysOfWeek": [ "monday","tuesday" ], "firstDayOfWeek": "monday", "index": "first", "interval": 2, "month": null, "type": "absoluteMonthly" }, "range": { "endDate": "2024-06-01T00:00:00.000Z", "numberOfOccurrences": null, "startDate": "2024-01-01T00:00:00.000Z", "type": "endDate" } }, "attendees": [ { "type": "required", "emailAddress": "user1@telecomx.dk", "name": "User 1", "statusResponse": "accepted", "statusTime": "2024-01-01T00:00:00.000Z" }, { "type": "required", "emailAddress": "user2@telecomx.dk", "name": "User 2", "statusResponse": "declined", "statusTime": "2024-01-01T00:02:00.000Z" } ], "statusResponse": "accepted", "statusTime": "2024-01-01T00:00:00.000Z", "categories": [ "Internal meeting", "Coffee", "Buns" ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | customer | Customer not found |
| 404 | employee | Employee not found |
| 422 | type | Type is missing or invalid |
| 422 | type | Creating series requires MS365 integration, which is not enabled for the customer |
| 409 | externalId | This externalId is already in use |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/pbx/calendar/create.txt · Last modified: 2025/01/14 12:54 by Per Møller