API Workflow - Pass custom data type

I have an API Workflow Endpoint which need custom data type (Filter) as parameter.

I’ve tried to “Post” with Filter UniqueID as a parameter - but this won’t work.
How I can call this Workflow outside Bubble editor via API?

It should work if you send something like this for the JSON body:

{“Filter”: “1478304281223x876028696241635300”}

1 Like

I’m writing in PowerShell (.Net) so here is my results:

The remote server returned an error: (400) Bad Request

Try a unique id that matches one of your rows : )

I’m sorry, what do you mean?

In my example I used a unique id from a thing from one of my apps: 1478304281223x876028696241635300

I saw in the screenshot that you used the same id, where you’d need to replace it with a Filter unique id.

What @mishav is saying is that the way you pass an object of complex (custom) type to a workflow outside of Bubble is by passing the unique ID of the object in question (as a string).

When Bubble sees this, it essentially Does a search for… that type with constraint unique ID = that string.

And yes, this does mean that such an object must already exist. So you may need to construct an API workflow that creates such a thing first (from primary data types that you provide) and returns that thing’s uID to you that can then be used in your search_adv API call.

I’m sorry guys, but I’m literally don’t understand what you’re trying to say.
The “thing” Filter is already created in Bubble. That Unique ID that you see in screenshot I’ve copied from Bubble editor.

The workflow works perfectly from a Bubble site, but not from API Calls.

I’m trying to pass particular Filter Unique ID as a parameter so my Workflow started to work.
Maybe that even isn’t possible?

This Filter’s unique ID is the one ending in 1500.

Pass that as the value for the Filter key.

Look at my second answer - I’m passing this Unique ID - nothing heppend.
Here is screenshot from Postman:

The problem with this is “form-data” which might not match the content-type …

Try this in Postman: for the body select “raw” then type “JSON”, then put a JSON as above.

Then check the header content-type should automatically set to application/json.

Alternatively, leave the body with form-data as you have it, and change the header content-type to “multipart/form-data”.

Same error.
Header set to: application/json

Hi @petrucho, you are very close to getting it to work.

The screenshot shows Headers(2), what is the second header? It might be causing the issue.

  1. Authorization Token
  2. Type

Everything now looks okay. I can generate the same error message if I have the parameter named differently.

I suggest you make a new test app, create an endpoint in it, and see if you can get it to work. If you get the same problems, share the test app with us so we can help.

@mishav @keith thanks so much you guys!
You’ll never believe what I did to get this thing working. 3… 2… 1…
I just re-created API Workflow Endpoint with different and everything started to work in a moment!

In addition: check your “things” spelling. If it’s starting with a capitalize letter - then in your program it should start capitalize also and otherwise.

3 Likes

I can believe it. @mishav is aware of some buggy behavior that can happen when configuring API Connector calls and I’ve been holding my tongue before saying, “Now that you know what to do, just start over from scratch.”

Glad you got it sorted!

This topic was automatically closed after 70 days. New replies are no longer allowed.