toby2
October 21, 2024, 12:16pm
1
Been trying to connect GoCardess’s bank accounts but cannot get it to work despite the postman working and API call working itself.
Postman
The issue is specifically calling this:
curl -X POST "https://bankaccountdata.gocardless.com/api/v2/token/new/" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"secret_id\":\"88674960-6cf0b59a84\", \"secret_key\":\"c06dc9be3bbd5b920593d366f728ab61716026e3815cdba69bcaf485d57de0f8bbd166fef235910ff02c411c430287f6e555537b8\"}"
and the error ends up being:
* Raw response for the API Status code 400 {"secret_id":["This field is required."],"secret_key":["This field is required."],"status_code":400}
So it looks like the secret_id and secret_key are not getting passed.
This is configured as a JSON body type.
If you try and just have the same JSON and use this link: https://bankaccountdata.gocardless.com/api/v2/token/new it will work (well it won’t because the key’s content is edited, but the keys are sent through)
The docs are the following: Bank Account Data - Quickstart Guide
bubble is just not sending through the keys… any ideas?
Toby
Jici
October 21, 2024, 1:00pm
2
Can sou share api connector settings? Did you add content type header?
toby2
October 23, 2024, 4:12pm
3
yup all that is setup.
Content-Type: application/json
Checked for spelling, etc.
It triggers, just the JSON doens’t get sent.
T.
Jici
October 23, 2024, 4:40pm
4
But how did you set the json? Please share a screenshot.
Jici
October 23, 2024, 5:06pm
5
If you copied and paste the escaped JSON… this is why it’s not working probably
{
"secret_id": "yoursecretid",
"secret_key": "yoursecretkey"
}
By the way, this kind of auth can be used in custom oauth2 token.
Jici
October 23, 2024, 5:33pm
7
Working for me:
Any shared header that could create issue?
toby2
October 23, 2024, 5:42pm
8
What did you use for the header? This is super weird…
I tried with this:
With the JSON being the same as you…
T
Jici
October 23, 2024, 5:48pm
9
I didn’t add any because bubble by default add one. And for Accept, doesn’T seem to be really mandatory.
toby2
October 23, 2024, 6:08pm
10
Well whatever you did is magic… cause I can’t see how it works…
Jici
October 23, 2024, 6:25pm
11
Start from scratch with a new API and call. In some rare case, Call get corrupted by attempt you did.
toby2
October 23, 2024, 6:56pm
12
yup did that - one a new project + even a new plugin…
toby2
October 23, 2024, 7:20pm
14
Yup same thing. Just a 400 the Jain isn’t being seen.
If I use oauth2 custom token I get that the secret_key is wrong… but it’s correct… soo that doesn’t help.
T
Jici
October 23, 2024, 8:42pm
15
I’ve checked and finally doesn’t think it will work for custom token because this is not returning the token_type parameter and doesn’t response with access_token but just “access” instead. Sorry.
Next step to debug this is to create a requestbin.com (or other similar tool) and send the request there and inspect
toby2
October 24, 2024, 3:07pm
16
Found it:
Importing the cURL will trim the trailing /
This means that the call wasn’t working correctly, and pointing to the wrong API. Needed /new/ instead of /new
Thanks bubble! grrr