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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
fieldIntegerID of field.Yes
stypeStringObject type. See below.Yes
snumberStringObject number.Yes
valueStringValue to set.Yes
customerIntegerID of customer object is in.NoCustomer of authentication user.
validationInteger1 to validate input then return, 0 for full action.No0

stypes "customer" and "phone" are currently supported. Other types may be added in future versions.

Responses

CodeDescription
204Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The 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

VersionChanges
4.0Function added.