HTTP Request - Error message is StrJsonObject : {"message":"invalid character 'P' looking for beginning of value","status":"fail"}

This is the WebApi package that I have in my project:
UiPath.WebAPI.Activities=1.21.0
This is the cURL request that I imported:

curl -X 'POST' \
  'https://simidigital.tm.com.my/api/cdn-portal/v1/generic' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint": "https://cdn-api.swiftfederation.com/v1.1/report/customers/32477/volume",
  "payload": {
    "endTime": "2024-10-17T23:59:59Z",
    "startTime":"2024-10-16T00:00:00Z"
  }
}'

The image displays a cURL HTTP POST request setup with JSON headers and data payload intended for a given API endpoint. (Captioned by AI)

This is the configuration that I had configured in the HTTP Request Wizard:

But when I run the workflow, I get this response:

StrJsonObject : {“message”:“invalid character ‘P’ looking for beginning of value”,“status”:“fail”}
Status : 400

Can someone tell me how I can configure the HTTP Request activity for the given cURL statement above.
Thank you very much.

We encouintered, that Curl import often required some post modelling on the HTTP Request Activity

However, we recommend to port it on the corresponding settings and not modelling extra

like:
grafik

And

place it on the body as payload
grafik

Thank you so much. I was able to solve the problem by moving the entire request JSON-payload and endpoint-to the body property of the HTTP Request.

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