updateTimeTemplates

Request Method: PUT

Description: Update a Time Template(s)

URL: https://api.iovox.com:444/Rules?v=3&method=updateTimeTemplates

The following parameters must be sent in the querystring:

ParameterDescriptionDefault ValueData TypeMandatory
vAPI version to use
INTEGERYES

Payload

The following XML payload must be sent with an updateTimeTemplates request:

<?xml version="1.0" encoding="UTF-8"?>
<request>
   <time_template>
     <label>Working hours in 2012</label>
     <new_label>New Working hours 2012</new_label>
     <time_frames>
       <time_frame>
         <date_from>2012-01-01</date_from>
         <date_to>2012-12-31</date_to>
         <recurrence>NONE</recurrence>
         <time_from>09:00</time_from>
         <time_to>18:00</time_to>
         <days>
           <day>MON</day>
           <day>TUE</day>
           <day>WED</day>
           <day>THU</day>
         </days>
       </time_frame>
       <time_frame>
         <date_from>2012-01-01</date_from>
         <date_to>2012-12-31</date_to>
         <recurrence>NONE</recurrence>
         <time_from>09:00</time_from>
         <time_to>18:00</time_to>
         <days>
           <day>FRI</day>
         </days>
       </time_frame>
     </time_frames>
   </time_template>
 </request>

Payload Description:

The following parameters can be sent in the querystring

Node NameDescriptionDefault ValueData TypeMandatory
labelLabel of the Time Template you want to update
STRINGYES
new_labelNew Label of the Time Template after updating
STRINGNO
time_frameContain informations about the frame of time
XMLYES
time_frame > date_fromStart date of the time frame,format YYYY-MM-DD. Can be empty to apply this time frame starting immediately
DATENO
time_frame > date_toEnd date of the time frame,format YYYY-MM-DD. Can be empty to apply this time frame forever
DATENO
time_frame > recurrenceSet the frequency mode of this time frame, can be one of theses values
YEARLY : repeat this frame every year, so don't care about the year value in dates
MONTHLY : repeat this frame every months, so don't care about the month value in dates
NONE : Apply the frame from date_from to date_to
NONESTRINGNO
time_frame > time_fromDaily start time of the time frame,format HH:MM00:00TIMENO
time_frame > time_toDaily end time of the time frame,format HH:MM23:59TIMENO
time_frame > days > dayDefine days where this template is applied. Insert all days to select all the week, or choose a sub set. Format is 3 character string of week days (e.g. MON, TUE or WED)
STRINGYES

Result

Error Result

HTTP CodeError StringResolution
400API Version EmptyAdd a value for the v parameter in the query string
400API Version InvalidCorrect v parameter
400Request Method must be POST. x attemptedSwitch request method x to POST
400XML EmptyAdd xml to the request body
400XML parse error. x at line y, column zCorrect XML at point x on line y, column z
400Request EmptyAdd at least one node to the request
400label X does not existCorrect the label X to a new one, or use the create method
400label X already existsCorrect the new_label X to a new one
400Time Template Label X invalidCorrect the label X
400Time frames emptyThere is not any time frame, a template cannot be empty
400Recurrence invalidCorrect the recurrence parameter, it can only be
YEARLY : repeat this frame every year, so don't care about the year value in dates
MONTHLY : repeat this frame every months, so don't care about the month value in dates
NONE : Apply the frame from date_from to date_to
400date_from invalidCorrect date to match the format YYYY-MM-DD
400date_to invalidCorrect date to match the format YYYY-MM-DD
400The start date is after the end dateCorrect date_from or date_to
400date_from and date_to must both be empty or both have a valueAn empty date_from and date_to means this frame doesn't have a range, then both must be empty. To select a range of time, full date_from and date_to.
400time_from invalidCorrect time to match the format HH:MM (must be between 00:00 and 23:59)
400time_to invalidCorrect time to match the format HH:MM (must be between 00:00 and 23:59)
400X is not a valid dayCorrect the value to be a valid day (only MON,TUE,WED,THU,FRI,SAT or SUN)
400Days EmptySelect days by adding "day" elements
400Time Frame X is too generalThe time frame you entered select all the time, it must only select a period of time. To update a blocking rule applied all the time, you must not assign it to a template
500Internal Server ErrorRetry later

Success Result

HTTP/1.1 201 Updated