|
6 | 6 | var CLIENT_ID = '...';
|
7 | 7 | var CLIENT_SECRET = '...';
|
8 | 8 |
|
| 9 | +var CLIENT_ID = '1000.7ETQMTBW3CZ8904161FVI075OUAH9H'; |
| 10 | +var CLIENT_SECRET = 'ff6ccb4c2e10105c1ba90ae92729570a7a783d918c'; |
| 11 | + |
9 | 12 | /**
|
10 | 13 | * Authorizes and makes a request to the Zoho CRM API.
|
11 | 14 | */
|
@@ -38,35 +41,35 @@ function reset() {
|
38 | 41 |
|
39 | 42 | /**
|
40 | 43 | * Configures the service.
|
41 |
| - * @param {string} optAccountServer The account server to use when requesting |
| 44 | + * @param {string} optAccountServer The account server to use when requesting |
42 | 45 | * tokens.
|
43 | 46 | */
|
44 | 47 | function getService(optAccountServer) {
|
45 | 48 | var service = OAuth2.createService('Zoho')
|
46 |
| - // Set the authorization base URL. |
| 49 | + // Set the authorization base URL. |
47 | 50 | .setAuthorizationBaseUrl('https://accounts.zoho.com/oauth/v2/auth')
|
48 | 51 |
|
49 | 52 | // Set the client ID and secret.
|
50 | 53 | .setClientId(CLIENT_ID)
|
51 | 54 | .setClientSecret(CLIENT_SECRET)
|
52 |
| - |
53 |
| - // Set scopes. See |
| 55 | + |
| 56 | + // Set scopes. See |
54 | 57 | // https://www.zoho.com/crm/developer/docs/api/oauth-overview.html#scopes.
|
55 | 58 | .setScope('ZohoCRM.org.all')
|
56 | 59 |
|
57 | 60 | // Set the name of the callback function that should be invoked to
|
58 | 61 | // complete the OAuth flow.
|
59 | 62 | .setCallbackFunction('authCallback')
|
60 |
| - |
| 63 | + |
61 | 64 | // Set the access type to "offline" to get a refresh token.
|
62 | 65 | .setParam('access_type', 'offline')
|
63 | 66 |
|
64 | 67 | // Set the property store where authorized tokens should be persisted.
|
65 | 68 | .setPropertyStore(PropertiesService.getUserProperties())
|
66 | 69 | .setCache(CacheService.getUserCache());
|
67 |
| - |
| 70 | + |
68 | 71 | // Set the token URL using the account server passed in or previously stored.
|
69 |
| - var accountServer = optAccountServer || |
| 72 | + var accountServer = optAccountServer || |
70 | 73 | service.getStorage().getValue('account-server');
|
71 | 74 | if (accountServer) {
|
72 | 75 | service.setTokenUrl(accountServer + '/oauth/v2/token');
|
|
0 commit comments