I usually don’t come here, because generally I can find answers to most everything, but I am absolutely stumped on this one.
I can get the API endpoint to succeed when I initialize my call. However, as soon as I try to pass the same data through the API plugin, it fails.
I have tried everything, and if I change something, a new line error proceeds. Unless, I make the call through the initialization.
To see how it was sending each way, I passed the data through pipedream using the workflow (failure), and then again while making the call through initializing (success).
I can copy the data directly from the failed body in pipedream, paste it into the initializer, and it works. But as soon as I try to make the same call with the workflow and the API plug in it fails.
I did notice that there is an extra header called Baggage when making the call through the initializer. I even tried adding that then sending it through the workflow, and still nada. Also, you can see that the json was parsed differently with the initializer call, than with the workflow call. I ran everything through a validator also.
Current setup, although I have tried a few different ones. And all the same results.
Been struggling with this for 3 days now. It seems to be a common theme amongst the API connector when passing arrays.
I think it’s absolutely ridiculous that there’s an obvious issue with the API connector, yet Bubble has done nothing to fix or address it, or if anyone requires help with it, they’re left to figure it out on their own or have to back end hack workflows.
GIVE US AN API CONNECTOR THAT DOESN’T PARSE OUR JSON INTO CRAP IT DOESNT NEED TO BE.
Can you clarify what works and what doesn’t? Such as:
Pipedream → Bubble API endpoint Initialize PASS (receive webhook)
Pipedream → Bubble API endpoint FAIL (receive webhook)
Bubble API Connector → Bubble API endpoint Initialize ?
Bubble API Connector → Bubble API endpoint ?
Can you also clarify where is your data source and where is the desired destination?
I then setup my workflow, the same way I did my test page, but the moment I try to pass that data through the api plugin, the same way I have set it up on all of my tests. It fails. No matter what I do, I get an error 400 that its not formatted correctly.
I setup a pipedream to see the output, and from what I can tell, the plugin is parsing the json list into another format. I have tried formatasjsonsafe. I have tried so many things, and I absolutely cannot get the data to pass through the api plugin successfully. I always get a formatting error or the most recent error is that json could not be formatted into bs.ms model library.
So, after some research. I believe its a serializer issue with the plugin and Azure Devops. I found an article about a converter built to get around this.
I still don’t understand why I can get the call to work from the initializer, but not through the plugin through a workflow. This article explains it better than I can.
I believe the issue is that the JSON all needs to be on the same line because Bubble actually passes a /n with the API body call, so where-ever there is a line break in your JSON, Bubble adds /n in the call body, so your JSON is no longer valid JSON.
It was a real pain to figure this out recently for myself, and once I found the thread on the forum that mentioned this, I changed my JSON to have no line breaks, all of it on the same line and it works.
Get used to this. Bubble has now decided to label these types of issues as ‘known limitations’ because they know there is a problem, but they refuse to address it properly through a fix, and have opted to just change the wording used to describe it.
Yea, I noticed that from the outputs I was getting. I think I tried it without the line breaks, because I have literally tried everything, but I will try it again. Won’t hurt, I’ve already tried everything a couple of a hundred dozen times anyways.
I am also going to give the JsoNest plugin a try, but I don’t see how it will help since once I pass the data through the API connector, it’s going to do its own thing anyways.
Very strange, and I am not sure the reasoning behind them doing that. What’s the purpose of the jsonsafe command, if Bubble is just going to try and make everything json safe anyways. Maybe so we can have it json safe-safe, idk.
But the crazy thing is too, is most of the outputs I am getting are json validated. Its just when I run it through the plugin module itself, it doesnt work -but can still be validated, but if I run the same data through just the initializer and not the plugin module - it works fine. Sometimes, I can’t even tell the difference between the two outputs, other than when I copy and past into a validator, and can see that its being serialized and parsed differently.
Also I keep getting the BS.MS parse error. Which has something to do with Azure, and in fact the server I am trying to post to does use Azure.
The screenshot of the API Connector shows all params as private, this means the workflow won’t be able to pass other values, I assume it is not the right screenshot?
Can you show the API call in the workflow where it uses JSONsafe?
JSONsafe for a text param puts "double quotes" around what it is passed, which would be an issue for the partial report number.
Can you show the matching mangled output and the API connector setup and the workflow API call?
This is the error:
“{"type":"RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content or more validation errors occurred.","status":400,"traceId":"00-2cb2123e057d39fed99a63e053d6631e-dfd4f9add821b594-01","errors":{"$.PowersToExecute[0]":["The JSON value could not be converted to BSMS.Model.Library.PowerExecutionReport.Request.PowerToExecute. Path: $.PowersToExecute[0] | LineNumber: 10 | BytePositionInLine: 262."]}}”
Now I know the error sees something in line 10, but the above screen shot is of the entire output being pasted into a validator, and its good.
Also, if I copy line 10, and paste it directly into the "PowersToExecute variable, and click initialize, we get it to work. Yet, the two outputs are slightly different in that, the json is serialized different, and Bubble adds a baggage header when passed through the initializer but not through plugin when being passed.
I needed to try it without spaces too. Try that @jnoblescas
I have no explanation for why spaces might break it, but it worked for me… And yeah, there should be a checkbox that stops format as text being formatted as JSON-safe…
Change the API URL in the API connector to a link at https://requestcatcher.com/ so you can see the raw body that’s being sent by Bubble to help debug. Run the raw body through a JSON validator to locate any issues.