Reporting with API live
fondationphardy
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Nov-01-2018
02:56 PM
Hello !
I am using Google script (with Google Spreadsheet) in order to access reporting (list of transactions) with Paypal API.
I managed to get a token using this function :
function getPaypalToken(){ var client_id = "..."; var secret = "..."; var options = { method: "post", headers : { "Authorization" : " Basic " + Utilities.base64Encode(client_id + ":" + secret), "Accept": "application/json", "Accept-Language": "en_US" }, payload: {"grant_type": "client_credentials"} }; var request = UrlFetchApp.fetch("https://api.paypal.com/v1/oauth2/token", options); var result = JSON.parse(request) return result.access_token; }
I check every box into my app preference :
But when I try that code, I get a PERMISSION_DENIED error...
var token = getPaypalToken() var headers = { 'Authorization': 'Bearer ' + token, }; var options = { "method" : "get", "headers": headers, }; var request = UrlFetchApp.fetch("https://api.paypal.com/v1/oauth2/token/userinfo?schema=openid", options) var result = JSON.parse(request) Logger.log(result);
THANK YOU for your help !
0 REPLIES 0
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Need help to integrate PayPal Standard Checkout with Adyen? in PayPal Upgrade Community
- Issue with Empty store_info in Response Using /v1/reporting/transactions on Sandbox API in REST APIs
- Paypal express checkout, payment they error "Sorry, something went wrong. Please try again." in PayPal Payments Standard
- IPN works in sandbox but not live in Sandbox Environment
- Connecting with site to take payments in Payflow