Forum Documentation Showcase Pricing Learn more

Missing parameter for workflow my_endpoint: parameter value

I created an API end_point that should read POST calls (with its value in the URL) and create a new entry in my database:

However when I’m testing the call in Postman as follows:

POST: https://myapp.bubbleapps.io/version-test/api/1.0/wf/edit_amount?value=2

the following 400 error occurs:

 "statusCode": 400,
  "body": "{\n    \"status\": \"MISSING_DATA\",\n    \"message\": \"Missing parameter for workflow edit_amount: parameter value\"\n}"

What is going wrong?

Thanks in advance

You are sending the numerical value in the URL when you should be sending it inside the POST request. That value parameter you set up (type number) is what is used to read the parameter in the POST request so you can then map it to your database in the Create New Thing Action.

Thank you @romanmg, this worked just fine.
However, is there a way to receive POST requests inside Bubble with data in the URL?

I think the way to do that is send that URL data to one of your app’s pages and from there trigger the API workflow.

How exactly can this be done?

Say your URL is the following:

myapp.bubbleapps.io/example?amount=30

On page “Example” have the following workflow:

When page is loaded and when get data from URL (parameter = amount) is not empty > schedule API workflow

Another possible route is to use Zapier to POST to the API endpoint. Not sure how your url with parameters is being generated in the first place, but you could use Zapier webhooks to receive the data you need and then send to endpoint.

Hey @emmanuel, I want to revive this thought and see if it’s something you guys can easily add…

Can we add the ability to “get data from URL” within the API Workflows area?

One use case is the original question in this post, but from what I understand his payload was fully sent in the URL, so there were workarounds. I have another use case when retrieving a webhook from an external shopping cart service. The issue is that the webhook payload does not include user account info, so we have no way of knowing whose data is coming in.

If we can have our users set up their webhook configuration with the endpoint plus an identifying parameter that contains their Bubble unique id (or something), we can then read that parameter as well and know whose shopping cart the data is coming from.

Part of this issue is the limited webhook data and the fact that the service itself has no API to begin with. Seeing as "get data from URL " inside API workflows would solve this issue for us completely (not to mention provide @thomas.schijf a much cleaner solution for his original question), it might be worth adding? If possible…?

It’s a data source, so wherever you have a dynamic expression you can have get data from an API. Including in actions.

Not sure I understand the issue.

Sorry, I’m not talking about Get data from an external API. In API Workflows, we don’t have the option “Get data from page URL” like we do in the regular app pages.

I want to retrieve a URL parameter from my own endpoint. For example, in SamCart (shopping cart service), I’d enter in my API endpoint here:

What I want to do is append a URL parameter to this endpoint so that each of my app users who want to integrate with their SamCart account will enter a “unique” endpoint in their SamCart settings. When a webhook goes out from SamCart to my app’s endpoint, I then want to retrieve the url parameter in addition to the rest of the JSON payload. I want to do this so that I know who the data is coming from when I go to create a thing in this API workflow. The webhook sends most of the data except for any identifying user information, so my parameter is to help me identify who it should be mapped backed to in my Bubble database.

It’s possible URL parameters in API endpoints isn’t a thing, and I just didn’t know… but if it is, my question to you is if that function can be added (Get data from page url).

1 Like

Oh sorry my bad.

Just add this as a parameter to your API endpoint, that’s what the parameters are.

Ah nice!! I thought those were just for the payload coming in… Excellent, will try it out today. Thanks!

Hi @romanmg did you get any success with an endpoint retrieving URL parameters?

I tried it just now and the value didn’t get passed through.

I actually tabled this , but I will try tomorrow and let you know. You added a URL parameter to the endpoint and then added that parameter as a key, yes?

Yes, this.

https://apppp.bubbleapps.io/version-test/version-test/api/1.0/wf/endpointname?param=value

Thanks for checking, Gaby!

Ok @mishav I just tried this out on a very basic setup, and can confirm that it doesn’t work for me either :frowning: The JSON payload comes in fine from the service (I’m testing with Shopify) but my URL param gets ignored.

Thanks for verifying this Gaby.

@emmanuel I’ve raised a bug report : )

Generally speaking for POST requests the parameters should be in the body of the request, and not as a querystring. Which is why you see this.

Is there any way to make querystring parameters accessible in API Workflow events?

1 Like

This isn’t standard. We can put that on the wish list but cannot commit on this yet. Why is it an issue?

I am needing this ability as well, to post parameters via the url