# Bubble API - OAuth2 Custom Token Request Rejected

**URL:** <https://forum.bubble.io/t/bubble-api-oauth2-custom-token-request-rejected/359792>\
**Category:** APIs\
**Created:** [February 15, 2025, 5:31pm UTC](https://forum.bubble.io/t/bubble-api-oauth2-custom-token-request-rejected/359792 "2025-02-15T17:31:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joerg.braner](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joerg.braner/32/242119_2.png) [@joerg.braner](https://forum.bubble.io/u/joerg.braner)\
**Post date:** [February 15, 2025, 5:31pm UTC](https://forum.bubble.io/t/bubble-api-oauth2-custom-token-request-rejected/359792/1 "2025-02-15T17:31:19Z")

</div>

Hey, I saw lots of blog post regarding Bubbles API & OAuth2 Custom Token, but after several attempts and reading lots of blogs, I still do not find the issue.

As you can see the request works with Curl and with Postman:

 ![curl_postman](https://us1.discourse-cdn.com/bubble/original/3X/3/7/37bdc943f2937cfbc8175f933acc2576473001ed.png)

Doing the same in Bubbles API:

 ![buuble api request](https://us1.discourse-cdn.com/bubble/original/3X/8/5/85701400de4f2d9aa927e4b65868dbabb9d1e9b0.png)

The result I am getting:

 ![bubble api error](https://us1.discourse-cdn.com/bubble/original/3X/5/c/5c89c5e40716c79cfdc92dc01bff8608ee28c2ad.png)

And just btw, the same happens if I do the authorisation as a separate call:

 ![individual authorisation](https://us1.discourse-cdn.com/bubble/original/3X/5/f/5f8c40808142e501edd3b906be10dd0772bcee08.png)

Creates the same result

 ![bubble api error individual](https://us1.discourse-cdn.com/bubble/original/3X/2/c/2c75a41f74645c560617d2aa1fc9279b99e04f2d.png)

I am really clueless, and appreciate hints what I am missing here

---

<div class="post-metadata">

**Author:** ![akamarski](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@akamarski](https://forum.bubble.io/u/akamarski)\
**Post date:** [February 15, 2025, 7:17pm UTC](https://forum.bubble.io/t/bubble-api-oauth2-custom-token-request-rejected/359792/2 "2025-02-15T19:17:39Z")

</div>

Your body parameters are not json. I guess you’d have to format them as json

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [February 15, 2025, 7:43pm UTC](https://forum.bubble.io/t/bubble-api-oauth2-custom-token-request-rejected/359792/3 "2025-02-15T19:43:42Z")

</div>

No. The problem is not there.

I suggest to send the call to service like requestbin from both api connector and postman and compare each request. I think that your issue could be related to username and password url encoding.

---

<div class="post-metadata">

**Author:** ![joerg.braner](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/joerg.braner/32/242119_2.png) [@joerg.braner](https://forum.bubble.io/u/joerg.braner)\
**Post date:** [February 16, 2025, 10:09am UTC](https://forum.bubble.io/t/bubble-api-oauth2-custom-token-request-rejected/359792/4 "2025-02-16T10:09:24Z")

</div>

Thx for the hint using requestbin, I was also thinking about that approach, but not yet found an easy to use tool. Actually, you are right, it is an encoding issue, in this case of special characters. Here the part of the payload shown by requestbin:

Postman:  
resource=https%3A%2F%[2Frollin.api.meine.bg-qseh.de](http://2Frollin.api.meine.bg-qseh.de)  
Bubble API:  
resource=[https://rollin.api.meine.bg-qseh.de](https://rollin.api.meine.bg-qseh.de)

So, using the already encoded payload in Bubble its seems working. Question remains, is there a way to convince [Bubble.io](http://Bubble.io) to perform the encoding itself?
