JSON API » alerts » alerts/update
Updates an existing alert.
Input parameters
Requires authentication and the administrator role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| id | Integer | ID of alert to update. | Yes | |
| calls | Integer | The minimum number of calls to send an alert for "peer" type. | No | Current value. |
| cost | Integer | The minimum cost to match, in the customer's currency. | No | Current value. |
| days_week | String | Which days the alert is active. Monday is 1, and Sunday is 7. "1,2,3,4,5" is Monday to Friday. | No | Current value. |
| description | String | Description. | No | Current value. |
| destination | String | The prefix of the destination to match. | No | Current value. |
| dnd_seconds | Integer | Minimum length of time telephone line has been in do not disturb for in seconds. -1 for no limit. | No | Current value. |
| emails | String | Email addresses to send alerts to. | No | Current value. |
| endhour | Integer | The end hour, from 0 to 23. | No | Current value. |
| endminute | Integer | The end minute, from 0 to 59. | No | Current value. |
| endsecond | Integer | The end second, from 0 to 59. | No | Current value. |
| events | Integer | 1 to record events for this alert, 0 not to. | No | Current value. |
| idle_seconds | Integer | Minimum length of time telephone line has been idle for in seconds. -1 for no limit. | No | Current value. |
| message | String | Destination to send text message to. | No | Current value. |
| minimum_affected | Integer | The minimum number affected to send an alert. | No | Current value. |
| minimum_calls | Integer | The minimum number of calls to send an alert for "outgroups" type. | No | Current value. |
| minimum_duration | Integer | The minimum call duration affected to send an alert. | No | Current value. |
| name | String | Name. | No | Current value. |
| peer | Integer | The ID of the peer to check. | No | Current value. |
| percent_fail | Integer | The minimum percent of calls failing to send an alert. | No | Current value. |
| period | Integer | The minimum interval to send alerts in seconds. | No | Current value. |
| search | Integer | 1 to use data from all customers on system, 0 not to. May only be used by system owners. | No | Current value. |
| starthour | Integer | The start hour, from 0 to 23. | No | Current value. |
| startminute | Integer | The start minute, from 0 to 59. | No | Current value. |
| startsecond | Integer | The start second, from 0 to 59. | No | Current value. |
| talktime | Integer | The minimum talk time to match in seconds. | No | Current value. |
| times | Integer | The minimum number of times to match. | No | Current value. |
| times_period | String | How long the times field applies to. "day", "week", or "month". | No | Current value. |
| type | String | What to alert on. "calls", "calls_start", "concurrent", "deregister", "destinations", "huntgroup_exit", "maximum", "registration_fail", "reregister", "numbers", "outgroups", "peer", "person_locked", "phone_address", "phone_locked", "phones", "queue_auto_unavailable", or "queue_exit". | No | Current value. |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
For each type, only some of the matching fields are used. See the web interface to determine which.
Responses
| Code | Description |
|---|---|
| 201 | Input passed validation. Only returned if validation=1. |
| 204 | Success. |
| 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. |
| 403 | Your rate plan does not allow this. |
| 404 | The alert does not exist, or you do not have permission to update it. |
Data returned
No data is returned.
Example: Changing the name
http://enswitch.example.com/api/json/alerts/update/?auth_username=user;auth_password=password;id=123;name=example{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
| Version | Changes |
|---|---|
| 4.4 | reregister type added. |
| 4.2 | calls_start type added. |
| 3.15 | type input parameter changed to allow a value of "huntgroup_exit" and "registration_fail". |
| 3.14 | type input parameter changed to allow a value of "phone_address". |
| 3.13 | Function added. |
