Struggle retrieving Paypal Access Token using ClientId and Secret 2021

Due to the lack of knowledge, I fail to set up general Paypal API call to get Acess Token. Need your help, guys.

Here, how Paypal wants me to do it:

How I’ve set it up:

What I got:

Thanks a lot

Hi @vovahumnytskiy - Since the curl command uses “-u” the API is expecting Basic Auth with username as CLIENT_ID and Password as CLIENT_SECRET.

Please try this way and check it out.

1 Like

I’ve already tried it. Doesn’t work ((


Did you try ‘oAuth2 Password Flow’ also? (instead of HTTP Basic Auth) which also takes username and password.

it requires additional field, I don’t know what to write there

As I’ve realized, I should refuse making separate call for Acess Toket retrieval
I should use “OAuth2 User-Agent Flow” API type.
But still no way I can set it up correctly. Doesn’t work :cry:




up :arrow_up: :arrow_up: :arrow_up:

Use auth: oAuth2 Custom token
Put in url
https://clientid:clientsecret@api-m.sandbox.paypal.com/v1/oauth2/token?grant_type=client_credentials

2 Likes

Hey, @Jici , thank you, it worked.
Do you know why User-Agent Flow does not work?

If you wan’t to use user-agent, it’s a different WF in this case to implement.

Do you need to requiere your user to auth with their own account?

no, I want to use Paypal API just to create webhooks from Bubble interface

Yes, but do you need just to access your own paypal account webhook or to let user link their paypal account and create webhook for their account?

I need to allow my users to create webhooks in their Paypal account

For Stripe it worked via “parameter in the URL” and my user just needed to provide their Stripe Secret and that is all

So you need them to create their own account and in this case, you need to use paypal connect process.
https://developer.paypal.com/docs/log-in-with-paypal/integrate/

The setup is different in dev dashboard to create it but also in Bubble.
Not sure, but If I remember, you will need to create the full process manually. Check on the forum you should find post about handling oauth2 manually

they create Paypal account outside of my Bubble app

Yes. It always the case.
But if you wan’t to create webhook in their account, you need to connect to their paypal.
Actually, you are connecting your own account only.

Regarding API call to create Paypal webhook, do you know what is the issue?

Paypal Instructions:
332

What I do:

Result: