Issue creating Task using API

Issue creating Task using API

Hi,

I've hit a bit of a snag trying to create a task programmatically in SCP. It works fine in Postman and in the API playground using:

{
    "task": {
        "title": "Other Task",
        "account": {
            "name": "My Company"
        }
    }
}

But when I bring it in Java I get this (Console): 
Creating task with payload: {"task":{"title":"Other Task","account":{"name":"My Company"}}}
Request URI: http://localhost/api/v3/tasks?TECHNICIAN_KEY=80B64C01-BEB0-4758-BDB4-AEA5C964F409&format=json&input_data=%7B%22task%22%3A%7B%22title%22%3A%22Other%20Task%22%2C%22account%22%3A%7B%22name%22%3A%22My%20Company%22%7D%7D%7D
Received error status: 400 BAD_REQUEST
Error response body: {"response_status":{"status_code":4000,"messages":[{"status_code":4001,"field":"input_data","type":"failed","message":"Unable to parse the JSON"}],"status":"failed"}}

But if I copy the payload from the console, decode it, I am able to use it as is in the REST API documentation "Add a Task" playground, and Postman.

So the json payload is ok. I wonder what it could be then,

Any help on this would be very much appreciated.

Regards,
Thierry

                New to ADSelfService Plus?