Problem using cURL & PHP to update custom field values on task


#1

Hi everyone. I’m attempting to use the php curl library to make updates to the custom field values on my task.

I am receiving an error which reads:
message":“Could not parse request data, invalid JSON”

This is the json_encoded data that I am attempting to send to the API:

{“data”:
{“custom_fields”:[
{“942857434893555”:“461842”},
{“755982650539871”:“755982650539872”},
{“755982650539885”:“http://www.lynda.com/jQuery-tutorials/jQuery-Web-
Designers/461842-2.html”}
]
}
}

It looks like valid JSON to me, and my JSONView browser extension displays it as JSON.

Does anyone know why the Asana API wont accept my data?

Please let me know if more information is needed to troubleshoot this problem.

Thanks!


#2

Hi,

The code formatting is all broken. Did you try to run it through https://jsonlint.com/ for example?


#3

Try using the format shown here to submit your custom field data: