Calendar API Overview
The LINE WORKS Calendar API (hereinafter "Calendar API" or "API") uses HTTP and a REST endpoint structure. Responses are usually available in JSON and OAuth 2.0 is used as the authentication method.
The Calendar API provides access to the LINE WORKS Calendar data, which are commonly used features.
★ Note : Please note that the "task" related APIs are not supported for the Lite product. |
---|
API Common Information
Supported Environment
LINE WORKS supports two environments: testing and live. However, the LINE WORKS Calendar API is available only in the live environment.
- Live environment: https://apis.worksmobile.com
Combine an HTTP method with the request URL to complete an operation. For example, here is the operation to create a calendar in the live environment.
Example) Operation for creating a calendar
- POST https://apis.worksmobile.com/{API ID}/calendar/createCalendar
You can see a request URL for each API call in the corresponding API details section.
Request Common
LINE WORKS Access Token and Consumer Key
With each API call, you should include a LINE WORKS access token and a consumer key in the request header. You can get the access token when you log in to the LINE WORKS system; it is re-issued every time that you log in to the system.
For how to get a consumer key, see API Common Guide.
The code below describes how to set a Works Mobile access token and a consumer key in the request header.
httpMethod.setRequestHeader("Authorization", "Works Mobile access token");
httpMethod.setRequestHeader("consumerKey", "consumer key");
userId
A client of the API Gateway (APIGW) uses cookie-based authorization methods. The APIGW parses cookies and adds the userId parameter to make the Calendar API call; therefore, you are not required to enter the userId parameter value.
Note
- For details on API authentication, refer to the Overview > Preparations section in the LINE WORKS Common Guide API Reference document.
Response Common
It returns an error message including the following information when an API call fails.
Property | Type | Required | Description |
---|---|---|---|
result | String | Y | Returns "fail" when an API call fails. |
errorMessage | String | Y | |
serverName | String | Y | Calendar server for which an API request is made. |
calledTimestamp | String | Y | Requested time |
requestUri | String | Y | Requested API URI |
remoteIp | String | Y | IP that called the calendar server |
result | String | Y | Description of error reason. |
See the following example code.
{
"result": "fail",
"errorMessage": "{\"serverName\":\"cvcapi02.caldf\",
\"calledTimestamp\":\"2016-08-25T14:58:24.760+09:00\",
\"requestUri\":\"/apigw/deskhomeBO/getScheduleList\",
\"remoteIp\":\"10.64.54.204\",
\"result\":\"com.naver.calendar.apigw.post.bean.CalendarException: cannot find userConf. userId\\u003d33578002\"
}"
}