Post response 14004, unrecognised token

I have an external service that posts a json form to an endpoint, but I cant seem to get backendless to acknowledge it, and sends the following response back to the service:

Status code: 400
Message: Bad Request
Body (Limited to 1000 chars): {“code”:14004,“message”:“Service invocation failed: Unrecognized token ‘scrapingjob_id’: was expecting (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)\n at [Source: (String)"scrapingjob_id=6951805&status=finished&sitemap_id=629248&sitemap_name=awrsList2"; line: 1, column: 15]”,“errorData”:{}}

The posted data from the external service doesnt appear as an object or an array, just as one string (output from webhook.site): scrapingjob_id=6635248&status=finished&sitemap_id=678945&sitemap_name=awrsList2

My usual methods of handling post API’s don’t seem to work and it cant pick up any object or numbers/string etc:
image

Any ideas on how to handle that string as ive not seen json formated that way before.

Hello @Andrew_Billcliffe

we will be happy to assist you. Please describe steps to reproduce and an expected result.

Hi Sergey, the external service simply sends the following string: scrapingjob_id=6635248&status=finished&sitemap_id=678945&sitemap_name=awrsList2

I cant seem to treat it as an object or parse it in codeless to retrieve the data I need and for my app to return a status 200.

if it were json format I’d expect something more like:

{
“scrapingjob_id”: 6635248,
“status”: “finished”,
“sitemap_id”: “678945”,
“sitemap_name”: “awrsList2”
}

and I could pick the object and extract the data I require. Is there a way to parse a string like that in codeless?

Hi Andrew,

Is your method declared as POST, PUT or GET operation?

Regards,
Mark

Hi Mark, Its declared as a POST operation. The external server executes a POST form submit with metadata from the job its just completed, but my codeless script cant seem to process it and sends back a 400 response stating it was expecting a json string, number etc.

its x-www-form-urlencoded rather than “standard” object response.

having said that, I have since found a few threads stating it cant be handled and a work around with regex such as this one.

for POST operations any arguments you declare should be in the request body. The PARAMETERS tab on the API Services screen will show the body schema.