Forum Academy Marketplace Showcase Pricing Features

Unrecognized field when adding through API

Hello, I am trying to add data to bubble from an external server, and for some reason it’s returning -
{"statusCode":400,"body":{"status":"ERROR","message":"Unrecognized field: img"}}

The url I am calling is via POST-
https://sdsdsdffd.bubbleapps.io/api/1.1/obj/ads/?api_token=myapikey
data being posted-
img=test.jpg&kaina=1&postoid=325&title=chair2&vieta=city1

and note that if I switch the order of parameters, for example post it like this -
kaina=1&postoid=325&title=chair2&vieta=city1&img=test.jpg

Then the error becomes -
{"statusCode":400,"body":{"status":"ERROR","message":"Unrecognized field: kaina"}}

Meaning that it’s the first parameter that’s always failing.
This is how my database is constructed-

And I have enabled the API access for ‘ads’ object like so -

So what gives? I don’t understand :roll_eyes:

Is it possible to see the logs of what the server is receiving? Maybe that would give a better explanation

One thing to check might be the option that appears just below the portion in your screenshot…

https://manual.bubble.io/core-resources/application-settings/api#use-field-display-instead-of-id-for-key-names

-Steve

2 Likes

That was it, thank you! :exploding_head:

1 Like

one more quick question , maybe you would know, how should I escape the & sign in the request if possible?
Edit - All good, just had to url encode the text containing & symbol :cowboy_hat_face:

1 Like