Jump to: navigation, search

Create Calendar

Method

POST

Syntax

 
/grs/v1/tenant/{tenantId}/package/{packageId}/calendar

Request Body

 
{
"name": "Dad's Calendar",
"weekStarts": 6,
"weekEnds": 7,
"dayStartsHour": 17,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 0,
"timeZoneId": "EST"
}

Response Body

 
{
"calendarId": "Calendar_117",
"name": "Dad's Calendar",
"locked": false,
"lockOwner": null,
"weekStarts": 6,
"weekEnds": 7,
"dayStartsHour": 17,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 0,
"timeZoneId": "EST"
}

HTTP Status Codes

  • 201 Created—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant, or does not have proper permission to perform this operation.
  • 422 Unprocessable Entity—Field Validation Error
 
{
  "message": "Validation Failed",
  "errors": [
    {
       "code" : "1000",
       "field" : "name",
       "message": "name must be specified"
    },
    {
       "code" : "1001",
       "field" : "weekStarts",
       "message": "weekStarts is invalid. Must be between 1 and 7."
    },
    {
       "code" : "1002",
       "field" : "weekEnds",
       "message": "weekEnds is invalid. Must be between 1 and 7."
    },
    {
       "code" : "1003",
       "field" : "dayStartsHour",
       "message": "dayStartsHour is invalid. Must be between 0 and 23."
    },
    {
       "code" : "1004",
       "field" : "dayEndsHour",
       "message": "dayEndsHour is invalid. Must be between 0 and 23."
    },
   {
       "code" : "1005",
       "field" : "dayStartsMin",
       "message": "dayStartsMin is invalid. Must be between 0 and 59."
    },
   {
       "code" : "1006",
       "field" : "dayEndsMin",
       "message": "dayEndsMin is invalid. Must be between 0 and 59."
    },
 {
       "code" : "1007",
       "field" : "timeZoneID",
       "message": "Unrecognized time zone ID."
    }
  ]
}
  • 503—Service Unavailable

Notes

User must have CALENDAR_CREATE and CALENDAR_VIEW permissions. Response will include calenderId which can be used on subsequent requests. WeekStarts / WeekEnds 1 - Sunday
2 - Monday
...
7 - Saturday

dayStartsHour : 0-23
dayStartsMin : 0-59
dayEndsHour : 0-23
dayEndsMin : 0-59
timeZoneId - As returned by Java's TimeZone class

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on May 16, 2017, at 00:20.