JSON API » fields » fields/list
Gets the fields of all custom fields.
Input parameters
Requires authentication and the user role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
customer | Integer | ID of customer to show fields for. 0 for all customers. | No | 0 |
hidden | Integer | 1 to show only hidden fields. 0 to show only non-hidden fields. -1 to show all fields. | No | -1 |
object | String | Return fields for specified object. "customer", "phone", or empty string for all. | No | Empty string. |
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid customer specified. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
Data returned
An array of fields, corresponding to the rows of the fields table in the database.
Example: With required parameters
http://enswitch.example.com/api/json/fields/list/?auth_username=user;auth_password=password{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "name":"example1", ... }, { "id":2, "name":"example2", ... } ] }
Example: Returning fields to display when editing a telephone line in customer 123
http://enswitch.example.com/api/json/fields/list/?auth_username=user;auth_password=password;customer=123;hidden=0;object=phone{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "name":"example1", ... }, { "id":2, "name":"example2", ... } ] }
Change history
Version | Changes |
---|---|
4.0 | Function added. |