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:
Parameter | Description | Default Value | Data Type | Mandatory |
v | API version to use | INTEGER | YES |
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 Name | Description | Default Value | Data Type | Mandatory |
label | Label of the Time Template you want to update | STRING | YES | |
new_label | New Label of the Time Template after updating | STRING | NO | |
time_frame | Contain informations about the frame of time | XML | YES | |
time_frame > date_from | Start date of the time frame,format YYYY-MM-DD. Can be empty to apply this time frame starting immediately | DATE | NO | |
time_frame > date_to | End date of the time frame,format YYYY-MM-DD. Can be empty to apply this time frame forever | DATE | NO | |
time_frame > recurrence | Set 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 | NONE | STRING | NO |
time_frame > time_from | Daily start time of the time frame,format HH:MM | 00:00 | TIME | NO |
time_frame > time_to | Daily end time of the time frame,format HH:MM | 23:59 | TIME | NO |
time_frame > days > day | Define 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) | STRING | YES |
Result¶
Error Result¶
HTTP Code | Error String | Resolution |
400 | API Version Empty | Add a value for the v parameter in the query string |
400 | API Version Invalid | Correct v parameter |
400 | Request Method must be POST. x attempted | Switch request method x to POST |
400 | XML Empty | Add xml to the request body |
400 | XML parse error. x at line y, column z | Correct XML at point x on line y, column z |
400 | Request Empty | Add at least one node to the request |
400 | label X does not exist | Correct the label X to a new one, or use the create method |
400 | label X already exists | Correct the new_label X to a new one |
400 | Time Template Label X invalid | Correct the label X |
400 | Time frames empty | There is not any time frame, a template cannot be empty |
400 | Recurrence invalid | Correct 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 |
400 | date_from invalid | Correct date to match the format YYYY-MM-DD |
400 | date_to invalid | Correct date to match the format YYYY-MM-DD |
400 | The start date is after the end date | Correct date_from or date_to |
400 | date_from and date_to must both be empty or both have a value | An 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. |
400 | time_from invalid | Correct time to match the format HH:MM (must be between 00:00 and 23:59) |
400 | time_to invalid | Correct time to match the format HH:MM (must be between 00:00 and 23:59) |
400 | X is not a valid day | Correct the value to be a valid day (only MON,TUE,WED,THU,FRI,SAT or SUN) |
400 | Days Empty | Select days by adding "day" elements |
400 | Time Frame X is too general | The 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 |
500 | Internal Server Error | Retry later |