JSON API » timegroups » timegroups/periods/update

Updates an existing time period.

Input parameters

Requires authentication and the administrator role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of time period to update.Yes
nameStringName.NoCurrent value.
days_monthStringDays 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.NoCurrent value.
days_weekStringDays of the week when active, separated by commas. Monday=1, Sunday=7. For example, "1,2,3,4,5" for week days.NoCurrent value.
descriptionStringDescription.NoCurrent value.
enddateIntegerEnd date in epoch formatNo0
endhourIntegerEnd hour from 0 to 23.NoCurrent value.
endminuteIntegerEnd minute from 0 to 59.NoCurrent value.
endsecondIntegerEnd second from 0 to 59NoCurrent value.
monthsStringMonths when active, separated by commas. Must be specified as two digits. For example, "01,02" for January and February.NoCurrent value.
repeatsInteger1 to indicate that the period will be repeated, 0 for notNo1
startdateIntegerStart date in epoch formatNo0
starthourIntegerStart hour from 0 to 23.NoCurrent value.
startminuteIntegerStart minute from 0 to 59.NoCurrent value.
startsecondIntegerStart second from 0 to 59.NoCurrent value.
yearsStringYears when active, separated by commas.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
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.
403Your rate plan does not allow this.
404The 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

VersionChanges
3.15repeats, startdate and enddate input parameters added.
3.13Function added.