JSON API » timegroups » timegroups/periods/update
Updates an existing time period.
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 time period to update. | Yes | |
| name | String | Name. | No | Current value. |
| days_month | String | Days of the month when active, separated by commas. Must be specified as two digits. For example, "01,02" for the first and second days of the month. | No | Current value. |
| days_week | String | Days of the week when active, separated by commas. Monday=1, Sunday=7. For example, "1,2,3,4,5" for week days. | No | Current value. |
| description | String | Description. | No | Current value. |
| enddate | Integer | End date in epoch format | No | 0 |
| endhour | Integer | End hour from 0 to 23. | No | Current value. |
| endminute | Integer | End minute from 0 to 59. | No | Current value. |
| endsecond | Integer | End second from 0 to 59 | No | Current value. |
| months | String | Months when active, separated by commas. Must be specified as two digits. For example, "01,02" for January and February. | No | Current value. |
| repeats | Integer | 1 to indicate that the period will be repeated, 0 for not | No | 1 |
| startdate | Integer | Start date in epoch format | No | 0 |
| starthour | Integer | Start hour from 0 to 23. | No | Current value. |
| startminute | Integer | Start minute from 0 to 59. | No | Current value. |
| startsecond | Integer | Start second from 0 to 59. | No | Current value. |
| years | String | Years when active, separated by commas. | No | Current value. |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
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 time period 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/timegroups/periods/update/?auth_username=user;auth_password=password;id=123;name=example{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
| Version | Changes |
|---|---|
| 3.15 | repeats, startdate and enddate input parameters added. |
| 3.13 | Function added. |
