UrlFetchApp with certificate/private keys

98 views
Skip to first unread message

Juan Ferrari

unread,
Jun 16, 2023, 9:31:15 AM6/16/23
to Google Apps Script Community
Hello people!

I use a lot the UrlFetchApp function in Google App Script to make different API requests, and its working perfectly.

The problem I'm encountering is that there are some providers or requests that needs a certificate or private key to invoke it. I usually run this requests via terminal command or via some python script, but I wanted to test it in Google App Script.

Do you know if its possible? This is a API request example of what I need:

curl -k --cert transport.pem --key private.key \
--location --request POST 'https://sandbox-oba-auth.revolut.com/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=accounts' \
--data-urlencode 'client_id=<your client_id>'



Thanks!
Reply all
Reply to author
Forward
0 new messages