HTTP request error: JSON content missing or malformed

Hello guys. I have ran into a problem. Im trying out oxylabs api, using UiPath HTTP reuqest activity. Im trying to get an answer from the api, but keep getting:
{
“status”: “Error”,
“message”: “JSON content missing or malformed.”
}
I dont understand why it is. I have done everything in the request biulder like this :

The curl in the oxylabs API playground looks like this and works:

curl --user “USERNAME:PASSWORD” ‘https://realtime.oxylabs.io/v1/queries’ -H “Content-Type: application/json” -d ‘{“source”: “universal”, “url”: “57010368AG Chrysler”}’

@Povilas_Jonikas

You can click on import and import the curl directly

Cheers

1 Like

Thanks for the response @Anil_G,

I did that. But the problem is, that it imports it incorrectly. The endpoint gets messed up and not all the parameters get imported. When I add them manually, i get that error above

@Povilas_Jonikas

Did you try in postman?

I dont think prameter post is required

Cheers

1 Like

Yes. Postman gives me the same answer and I cant figure out why.

I tried without the POST parameter, but it still gives the same answer

@Povilas_Jonikas

  1. Then there must be some mistake inthe way it is given
  2. To validate after filling in postman …even that would give a curl validate the curl with the one you have and see if there are any differences and correct it

Cheers

1 Like

Just figured out how to insert it in postman and it worked. But still keep getting the same error in UiPath. I saw, that postman has Body like this: {“source”: “universal”, “url”: “57010368AG Chrysler”, “render”: “html”}

How can i get the same in UiPath http request body activity?

@Povilas_Jonikas

body can be added in properties field directly

u

make sure you escape the double quotes with extra double quotes

"{""source"": ""universal"", ""url"": ""[57010368AG Chrysler](https://avtopro.ua/zapchastyna-582-CHRYSLER-57010368AG/)"", ""render"": ""html""}"

cheers

1 Like

Thanks for the help @Anil_G , but I still cant make it work… I inserted the body. Still get the same message. Is it possible, that the error is caused by the response? Because the response should be massive

@Povilas_Jonikas

If you have the postman collection if you can share, can check and give you how to do on UiPath

cheers

1 Like

For sure. Here you go: https://crimson-crater-943364.postman.co/workspace/dwadawd~94866cd4-4e4a-4415-80ff-4f9e1279984f/request/28432518-3490db2b-f10d-47d1-94ea-2ef2b119899c?action=share&creator=28432518&ctx=documentation

The Authorization values Username and Password, I have deleted for security reasons

@Povilas_Jonikas

I tried it from my end and I can see the import is proper…but again because username and pass are not there could not verify what the issue is

cheers

1 Like

@Povilas_Jonikas

Please use the headers and body in respective fields

and make sure to provide the authentication details properly…that should fix the issue

cheers

1 Like

It surely did. Thanks a lot, LEGEND! :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.