Difference between revisions of "Google Calendar Sync"
Ashley DeBon (talk | contribs) (Created page with "== Google Calendar Sync == === Base URL === https://apimobile.callproof.com === Endpoint === /api/calendar/google-sync/ === Purpose === Connects the authenticated user’s...") |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | == Google Calendar Sync == | + | == [[Mobile_API]] »Google Calendar Sync == |
=== Base URL === | === Base URL === | ||
| Line 43: | Line 43: | ||
| user_profile_image || file || No || Optional profile image to upload only when the user does not already have a profile image | | user_profile_image || file || No || Optional profile image to upload only when the user does not already have a profile image | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/calendar/google-sync/' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'device_type="android"' \ --form 'auth_code="YOUR_GOOGLE_AUTH_CODE"' \ --form 'user_profile_image=@"/path/to/your/profile-image.jpg"' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/calendar/google-sync/' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'device_type="ios"' \ --form 'auth_code="YOUR_GOOGLE_AUTH_CODE"' \ --form 'user_profile_image=@"/path/to/your/profile-image.jpg"' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 12:19, 21 July 2026
Contents
Mobile_API »Google Calendar Sync
Base URL
https://apimobile.callproof.com
Endpoint
/api/calendar/google-sync/
Purpose
Connects the authenticated user’s account to Google Calendar using an OAuth authorization code. Stores the Google tokens for the given device type, clears any previously selected Google calendar follow-up selection, and optionally uploads a user profile image when one is not already set.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
| Content-Type | Conditional | Use multipart/form-data when uploading user_profile_image
|
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 used for Google OAuth client credentials. Supported values: ios, android
|
| auth_code | string | Yes | Google OAuth authorization code used to generate access tokens |
| user_profile_image | file | No | Optional profile image to upload only when the user does not already have a profile image |
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/calendar/google-sync/' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'device_type="android"' \ --form 'auth_code="YOUR_GOOGLE_AUTH_CODE"' \ --form 'user_profile_image=@"/path/to/your/profile-image.jpg"'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/calendar/google-sync/' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'device_type="ios"' \ --form 'auth_code="YOUR_GOOGLE_AUTH_CODE"' \ --form 'user_profile_image=@"/path/to/your/profile-image.jpg"'
Successful Response (200)
Indicates that Google Calendar was synced successfully.
| 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, "Google 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 – Google Calendar could not be synced |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 401) – Missing
device_typeorauth_code. - 400 – Invalid device type ("Invalid DeviceType"), invalid/expired Google token ("Invalid Token"), or sync failure (for example, "Error while syncing the Google Calendar").
- 401 – Authentication failed or the access token is missing/expired.