Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Nov-01-2018
Country: France
Type: Business
fondationphardy
fondationphardy Contributor
Contributor
2
Posts
0
Kudos
0
Solutions
Your PayPal Anniversary
The Return
Organized
Active
View all
Latest Contributions by fondationphardy
  • Topics fondationphardy has Participated In
  • Latest Contributions by fondationphardy

Reporting with Paypal API in Google Script

by fondationphardy Contributor in Sandbox Environment
‎Nov-03-2018 06:51 AM
‎Nov-03-2018 06:51 AM
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 (live section) : 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) THANK YOU for your help ! ... View more

Reporting with API live

by fondationphardy Contributor in REST APIs
‎Nov-01-2018 02:56 PM
‎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 ! ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros