API Connector Issues - Initialize Works but Dynamic Data Doesn't

Hey Bubble Community :wave:

Since Bubble is taking over 2 weeks to get back to me about solving this issue. I thought I would post it here and see if anyone has a workaround to get this to work.

This happens with multiple APIs so far and I am not sure what Bubble is doing differently to make it not work. I vaguely remember something on the forum about it but can’t find the post.

Here is the issue:

I am trying to post, as an example, to LinkedIn as a Business Page. I set up the API call with the API Connector and it works fine. It initializes fine. When I go through the workflow it fails but I actually copy the data I am sending in the workflow to a dataType called Dev Log so I can see if there are any mistakes on my end. I check the JSON format, it is valid. I then use the SAME EXACT DATA and put it in the API Connector, and it works. :man_facepalming:

Why would this work in the API connector but not in a workflow. This is the error I am getting in the workflow:

{"status":400,"code":"ILLEGAL_ARGUMENT","message":"Request body could not be converted to data map"}"

Here is the screenshot of the workflow that is causing the issue.

Here is the API Connector screenshot:

Any ideas? Is there a reason I shouldn’t have the whole body as dynamic? Does that normally give issues?

Can you check if the data are available at the endpoint?
I believe it’s the same issue I highlighted 4 days ago now but Bubble support decided to ignore me and others.
Dynamic data are not populated on API call in multiple parts of my app. We thought it affected only user data but it’s clear now it affects also other functions.

This has been going on for weeks for me, it’s not a new issue. I can see the data in the logs as well. So the data is being passed through. It just doesn’t like it for some reason. :man_shrugging:

Thanks for your response. :blush:

Try to send the request to requestbin.com (or similar tool) and inspect body

1 Like

Also, do it for both, the initialize request (manually entered payload in API Connector) and in run mode to compare both.

Ok, I will try that to see what it says.

1 Like

How do you send dynamic data to RequestBin? Or better, how do you put it in the code?

Should I send them as parameters? This is what I am trying to test.


Never used RequestBin before. :man_shrugging:

I have used Postman and can get it to work from there without an issue.

How do I reference the ‘steps’ object in the code and how do I send it along from the API Connector is what I am trying to do I guess. :blush:

You just need to change your URL to the requestbin one. Send the request that work in API connector to initialize your call (don’t save the response, this should keep the initial response you got when initialized correctly). After, just run your workflow to send it from dynamic data like you are doing when running the action with the “correct” url.

The goal is just to validate the payload sent (that is often hard to see in Bubble logs)

The URL is the request bin one. I Just deleted some of the numbers for the screen shot. :blush:

So I don’t need to post it to LinkedIn in RequestBin, just validate the payload somehow?

Exactly. This won’t do anything to linkedin API. But you will be able to compare the payload from Connector (that work) VS run mode (workflow) that doesn’t and find if the body have an issue.
If requestbin doesn’t parse the body, you can copy it in jsonlint to find the error in the json.

I know that sometimes Bubble send the request payload with line return and space encoded. (I didn’t investigate if this happen more with arbitrary-text…) In most case, to fix that you just need to remove all newline and space in the payload to just have a single string. (By space, I mean in the json structure, not in the values or keys. So for example:

{
    "key 1": "value 1",
    "key 2": "value 2"
}

will become

{"key 1":"value 1","key 2":"value 2"}
2 Likes

I will try this. Maybe bubble is adding in something here. I will remove spaces and line breaks to see if it helps. :+1:

:man_facepalming: Now I am getting this error: {"status":429,"serviceErrorCode":101,"code":"TOO_MANY_REQUESTS","message":"Resource level throttle APPLICATION_AND_MEMBER DAY limit for calls to this resource is reached."}"

I think I need to wait to test again. This is weird though, why would it limit me. Maybe I need to try a different company.

Good question. Sometimes, this is considering all request from Bubble (like OpenAI for example). This could be related to api key too. Read documentation to know more about that.

1 Like

Thanks @Jici
I think I need to wait for now.

1 Like

I am currently having the same issue with the linkedin api and same error.

One moment I can send the text and the next I cannot. It works through the api but then on the live app it does not.

This seemed to have solved the issue I was having. Still some things to work out, but removing all of the return and spaces seems like the main issue. So weird that it works sometimes but not others. :man_shrugging: Thanks @Jici

1 Like