Struggle retrieving Paypal Access Token using ClientId and Secret 2021

You should use json instead
Add header
Content-type with value to application/json
Delete your parameters
And add this in body:

  "url": "<webhook_url>",
  "event_types": [
1 Like

Perfect! Works! Thanks!!! :slightly_smiling_face:

1 Like

I have the same issue for Stripe. I’ve already finished it.
User connect Stripe to Bubble app by

  1. Writing his Stripe Secret in the input in Bubble
  2. Tapping button “Connect Stripe”

On the background I call the same API call that I’ve helped me above, but for Stripe. In the call I just use user’s Secret, this “Secret” parameter in my call is not private, I use “Private key in header”.
It works perfectly.

But for Paypal for this “OAuth2 Custom Token” I am not sure how to dynamically send user’s credentials in the URL

If you wan’t to do that, you need to manually do the step. Create an API call that get the token and manually set header for your API Calls.

Well, this manual call was the reason why I’ve created this thread )

Just set the exact same thing in an API Call (POST call to the token endpoint). Set it as DATA request. replace client id and client secret with https://[clientid]:[clientsecret]@…
You will be able to dynamically fill this information
Use this call when you call other API Call by adding Authorization header with value Bearer
and add the access token from the GET Token endpoint

But honestly, you should consider the normal oAuth2 authorization code WF to authenticate user in Both Stripe and Paypal. User doesn’t need to create their own dev account or API key and just need to connect.

I don’t understand you here. Do you mean this? It doesn’t give me the ability to dynamically set client id and secret

You need to use that in API Call and remove the auth from Bubble to self handled
You cannot dynamically fill any information in Bubble Auth part.

1 Like

So, this URL would be as a header? What is header name?

No. In the url
No header for this call.

But for you call like Create webhook, you will add an Authorization header and use the result of the Token call.

now I have 1 idea, would implement and come back to you in a minute

Did you meant this to get access token?


Yes exactly
Change the call to POST


1 Like

why don’t I use https://[client]:[secret]@ in every call? Including the call to create webhook?

Because you cannot. You need to get access token. Call are authorized by the access token only. It’s not like stripe.

1 Like

Thank you @Jici, it seems that Paypal is ready. Thank you so much! The only thing left is to subscribe my Bubble endpoint to Paypal

1 Like

Hi, @Jici . I’ve managed to make oAuth for Stripe. Now my users login into their account and once they do this, they are connected to my Stripe Connect platform and I have control over their accounts.

I can’t find similar for Paypal, the only thing I see is just Log In with Paypal to retrieve user data.

Do you now any Paypal solutions for Auth? I need to Sign In my users and create webhooks in their accounts. From what I’ve seen, Paypal just give me opportunity to send GET requests, no POSTs.

Papal has “Onboard Sellers”, it allows me to get user’s clientID and secret, but I am not sure I would be able to create webhook for this user in his account. Also, “Seller” sounds irrelevant, like it narrows the audience that can use my app then.