JSON API » fields » fields/values/set
Sets the value of a custom field for a given object.
Input parameters
Requires authentication and the user role privilege. In addition, access to the object specified is required.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| field | Integer | ID of field. | Yes | |
| stype | String | Object type. See below. | Yes | |
| snumber | String | Object number. | Yes | |
| value | String | Value to set. | Yes | |
| customer | Integer | ID of customer object is in. | No | Customer of authentication user. |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
stypes "customer" and "phone" are currently supported. Other types may be added in future versions.
Responses
| Code | Description |
|---|---|
| 204 | Success. |
| 201 | Input passed validation. Only returned if validation=1. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The custom field does not exist. |
Data returned
No data is returned.
Example: With required parameters
http://enswitch.example.com/api/json/fields/values/set/?auth_username=user;auth_password=password;field=1;stype=phone;snumber=1234567;value=example1{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
| Version | Changes |
|---|---|
| 4.0 | Function added. |
