Reputation: 91
Sorry I don't have much knowledge in how this stuff works so...
I have a Bitrix24 site running and it has an API, it uses OAuth 2.0 protocol.
I want to create a Google Apps Script web apps (or API executable if it's more appropriate) that will interact with that external API.
From what I understand from the process, I call a page in the Bitrix24 site, which includes a callback URL, and the authentication info is sent to that callback page (https://training.bitrix24.com/rest_help/oauth/authentication.php).
I need to know if I can use Google Apps Script as this callback page. I have been searching but I don't think it's possible to use a web app's function, but maybe I'm looking at it from a wrong angle.
I hope someone can help in how this should be done, or say it's not possible at all.
Thanks in advance!
Upvotes: 1
Views: 1928
Reputation: 11
If it can help, I think there are 2 options :
1 - you can deploy a Web App with a doPost() function that will receive the Callback from Bitrix24. Example :
function doPost(e) { Logger.log(JSON.stringify(e)); }
Deploy your Web App to be accessible to anyone, and with "Execute the app as me" option. Then get this Web App's URL (something like https://script.google.com/..../exec) and pass it as your Callback URL parameter when calling Bitrix24
2 - you can also call Bitrix24 directly from you GAS Web App, using a state token to generate the CallBack URL. More information here : https://developers.google.com/apps-script/reference/script/state-token-builder
Upvotes: 1