Hi I am trying to do a query to Parse. com and I use right parameters, but I receive from JSON response this: {"code":111,"error":"invalid type for key userid, expected *_User, but got string"}
Here is the code:
$url = 'https://api.parse.com/1/classes/Tasks';
$headers = array(
"Content-Type: application/json",
"X-Parse-Application-Id: " . $appId,
"X-Parse-REST-API-Key: " . $restKey
);
$objectData = '{"userid":"hQsxiherY2", "tasktitle":"my first title", "taskcontent":"my first content"}';
$rest = curl_init();
curl_setopt($rest,CURLOPT_URL,$url);
curl_setopt($rest,CURLOPT_POST,1);
curl_setopt($rest,CURLOPT_POSTFIELDS,$objectData);
curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);
curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($rest);
echo $response;
curl_close($rest);
Something is wrong in $objectData->userid maybe I don't send something right... Anyone who use Parse. com and knows where is my mistake ? What I have to send ?