Google Workspace Add-Ons
Simplify your Google Workspace Add-Ons development with Aurinko's backend services for user management, third-party integrations, and offline access.
curl -u ClientId:Secret -X POST https:/api.aurinko.io/v1/am/accounts?userAccount=primary -d '{ "serviceType": "Google", "loginString": "{userEmail}", "email": "{userEmail}", "authOrgId": "{emailDomain}", "active": true }'{ "userId": "7082f6ab-6339-4b6a-85f9-afb16515c906", "userSession": "eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InJtYiI6InRydWUiLCJjbGllbnRJZ CI6ImUyNGIwNGZjNmRhYjdjODI3ODEzZGEzODFiNGJmMDZkIiwiaWF0IjoiMTYxNDY5NTQ0OSIsInR 5cGUiOiJ0b2tlbiIsImVuZFVzZXJJZCI6IjcwODJmNmFiLTYzMzktNGI2YS04NWY5LWFmYjE2NTE1Y zkwNiJ9LCJuYmYiOjE2MTQ2OTU0NDksImlhdCI6MTYxNDY5NTQ0OX0.jfpK11tI1QWpfivpu7MP\_Y ksIXnKSMqSD9IMfd0Y2fY" }PropertiesService.getUserProperties().setProperties({ 'userId': response['userId'], 'userSession': response['userSession'] })curl -X GET -G https:/api.aurinko.io/v1/auth/authorize -d clientId='{APPLICATION_ID}' -d serviceType='{MyCRM}' -d userAccount=primary -d scopes='Mail.Read Contacts.Read' -d responseType='none' -d userId='{AurinkoUserId}' -d state='{addonState}' -d returnUrl='{addonReturnUrl}' -d timestamp='{currentTimestamp}' -d userSignature='{signature}'var timestamp = Math.floor(Date.now() / 1000) var userSignature = Utilities.base64EncodeWebSafe( Utilities.computeHmacSha256Signature( stringToBytes(userId() + timestamp), Utilities.base64DecodeWebSafe(auClientSecret)))var state = ScriptApp.newStateToken() .withMethod('authCallback') .withTimeout(3600) //?? .createToken();var returnUrl = encodeURIComponent('https://script.google.com/macros/d/' + ScriptApp.getScriptId() + '/usercallback');curl -X GET -G https:/api.aurinko.io/v1/auth/authorize -d clientId='{APPLICATION_ID}' -d serviceType='{MyCRM}' -d userAccount=secondary -d responseType='none' -d userId='{AurinkoUserId}' -d state='{addonState}' -d returnUrl='{addonReturnUrl}' -d timestamp='{currentTimestamp}' -d userSignature='{addonSignature}'function userSession() { return PropertiesService.getUserProperties().getProperty('userSession'); }curl -H 'X-Aurinko-Session: {userSession}' -X GET -G https://api.aurinko.io/v1/user{ "id": "3df3ce21-07c0-4cec-a8de-ed4c570ee15c", "appId": 1, "email": "[email protected]", "authOrgId": "yoxel.net", "trustedIdentity": true, "accounts": [ { "id": 2739, "serviceType": "Google", "type": "primary", "active": true, "daemon": false, "loginString": "[email protected]", "email": "[email protected]", "name": "Google User", "authUserId": "abcdabcb-ad8d-4bee-bd69-787675478785", "authOrgId": "yoxel.net", "authObtainedAt": "2021-03-21T16:58:56.823Z" }, { "id": 2740, "serviceType": "{MyCRM}", "type": "secondary", "active": true, "daemon": false, "loginString": "[email protected]", "email": "[email protected]", "name": "Crm User", "serverUrl": "https://crm.instance", "authUserId": "374", "authOrgId": "999", "authObtainedAt": "2021-03-21T17:39:10.513Z" } ] }curl -H 'X-Aurinko-Session: {userSession}' -H 'X-Aurinko-AccountId: 2739' -X GET https:/api.aurinko.io/v1/email/messages curl -H 'X-Aurinko-Session: {userSession}' -H 'X-Aurinko-AccountId: 2740' -X GET https:/api.aurinko.io/v1/contacts
Last updated
Was this helpful?