Add object to relationship in users table

Hi. I am trying to add an object in one-to-one relationship in users table using REST API from PHP. These are the request and response:

Request:
PUT /v1/users/1763D7F3-4FD4-E1D7-FF01-62BE79D9B400 HTTP/1.1
Host: api.backendless.com
User-Agent: Guzzle/3.8.0 curl/7.28.1 PHP/5.4.10
application-id: XXXXXXXXXXXXXXXX
secret-key: XXXXXXXXXXXXXXXX
application-type: REST
Content-Type: application/json
user-token: 16CC82B7-CF50-C112-FFD6-295F048E2700
Content-Length: 48
{“local”:“BD599A4C-EE35-C40C-FF07-EAD474D79D00”} [] []

Response:
HTTP/1.1 200 OK
Server: nginx/1.4.2
Date: Mon, 24 Feb 2014 08:44:20 GMT
Content-Type: application/octet-stream
Content-Length: 434
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: origin, application-id, application-type, content-type, secret-key, request, user-token
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Cache-Control: no-cache, : no-store, no-cache, must-revalidate, private
Pragma: : no-cache

But i do not see anything in the related column in admin console. I do not know if im doing it right (maybe i am missing something in the request?) or if there is a problem with admin console that does not refresh changes.

Hi Andrés,

Here’s a request I just tried and it works:

curl 
-H application-id:<MY-APP-ID>
-H secret-key:<MY-REST-SECRET-KEY>  
-H Content-Type:application/json 
-H application-type:REST 
-H user-token:2A18292E-01DD-49D9-FF33-22818CE4C000  
-X PUT -d '{"contact":{"objectId":"EE075971-D3A2-FCF3-FFB9-976AB569C100", "___class":"Contact"}}' 
-v http://api.backendless.com/v1/users/<USER-ID-OF-THE-USER-TO-CHANGE> 

where:

    user-token header - this is the value you get when you perform login for the user. Updating a user requires that the user is logged in. ___class:"Contact" - this is the name of the table where the related object you are adding to the user belongs to "objectId":"EE075971-D3A2-FCF3-FFB9-976AB569C100" - if you are adding an existing object, you must include objectId property with the value.
Hope this helps!

Mark

Ok, i see i was making a bad request. I will try with your suggestion. Thanks Mark!