Office Calendar Sync

From docs
Jump to: navigation, search

Mobile_API » Office Calendar Sync

Base URL

https://apimobile.callproof.com

Endpoint

/api/calendar/office-sync/

Purpose

Connects the authenticated user’s Microsoft Office calendar by storing Office OAuth tokens for the device. On successful token storage, any previously selected Office calendar preference for the user is cleared so a calendar can be chosen again.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

None.

Request Body

Parameter Type Required Description
device_type string Yes Device platform; must be ios or android
token string Yes Office ID token from the Microsoft sign-in flow
access_token string Yes Office OAuth access token
expires_in integer/string Yes Access token expiry duration (seconds)
refresh_token string No Office OAuth refresh token used to renew access

cURL Example for Android

 curl --location 'https://apimobile.callproof.com/api/calendar/office-sync/' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "device_type": "android", "token": "YOUR_OFFICE_ID_TOKEN", "access_token": "YOUR_OFFICE_ACCESS_TOKEN", "expires_in": YOUR_EXPIRES_IN_SECONDS, "refresh_token": "" }' 

cURL Example for iOS

 curl --location 'https://apimobile.callproof.com/api/calendar/office-sync/' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "device_type": "ios", "token": "YOUR_OFFICE_ID_TOKEN", "access_token": "YOUR_OFFICE_ACCESS_TOKEN", "expires_in": YOUR_EXPIRES_IN_SECONDS, "refresh_token": "" }' 

Successful Response (200)

Indicates that Office calendar credentials were stored / sync completed.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
message string Confirmation message (for example, "Microsoft Office Calendar Synced Succesfully")
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation failed – response body uses clientStatusCode 401 with the first validation error message
400 Bad Request – Office calendar sync failed
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Missing device_type, token, access_token, or expires_in.
  • 400 – Invalid device type, or sync failure (for example, "Error In Microsoft Office Calendar Sync").
  • 401 – Authentication failed or the access token is missing/expired.