Suppose we already created a custom field named company for users, now we want to update this attribute for user with user_id 15 with parspooyesh value. In this scenario we have already authenticated with IBSng:
- client IP address: 192.168.1.101
- IBSng WS server and port: 192.168.1.104:1237
- auth_name: system
- auth_session: w6ig5hwv1ohv
$ curl -H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Accept-Charset: utf-8" \
-H "Cache-Control: no-cache" \
-X POST \
-d '{"params": {"auth_remoteaddr": "192.168.1.101", "auth_type": "ADMIN", "auth_name": "system", "auth_session": "w6ig5hwv1ohv", "user_id": "15", "attrs": {"custom_fields": [{"custom_field_company": "parspooyesh"}, []]}, "to_del_attrs": []}, "method": "user.updateUserAttrs"}' \
http://192.168.1.104:1237/
Output:
{"id": null, "result": "", "error": null}
In response you will receive nothing which is a good sign that your request executed successfully (of course you must check that the value of error field is null).