Forum Discussion

iarriola's avatar
8 years ago

Error code 511 - A required query string argument is missing

I am trying to update user custom fields using the community V1 REST API, and I am getting a server error code - 511 Network Authentication Required - when doing a POSt operation over the user. The object than contains the custom fields is "settings" so I'm trying the following:

------------------------------------------------------------------------

POST /restapi/v1/users/id/6463/settings/name/custom.field.fiel_name/set?custom.field.fiel_name=SomeValue&restapi.response_format=json&restapi.session_key={sOmEsEsSiOn.}

HTTP/1.1
Authorization: Basic someAuth
Host: community.staging.company.com
Content-Length: 0

------------------------------------------------------------------------

 

and getting the response:

 

{
    "response": {
    "status": "error",
       "error": {
          "code": 511,
          "message": "A required query string argument is missing."
       }
    }
}

 

After doing a self request, I get the full list of available fields to update.

/restapi/v1/users/self/settings

 

{
    "response": {
    "status": "success",
    "settings": {
    "type": "settings",
    "href": "\/users\/id\/6463\/settings",
    "setting": [

       ...

    ]

]

 

Any ideas?

 

Thanks,

Ivan.

 

2 Replies

  • iarriola's avatar
    iarriola
    Ace
    8 years ago

    Hi VikasB, thanks a lot for your quick response. It worked perfectly, the only missing part was actually sending as a query parameter the keyword

    value, including the actual value.

     

    This is how the actual request end up:

    POST /restapi/v1/users/id/6463/settings/name/custom.profile.company_name/set?value=MyConsulting

     

    and including security parameters and headers to work:

    &restapi.response_format=json
    &restapi.session_key=JMjXWUQLkPw59YijeiZDprll-KOvf6Gm4I6HZkPxS5M. 
    
    Authorization: Basic cm9ja2V0bGF3eWVyMoOnAwrcNrcHGv

    Thanks again!