Difference between revisions of "API Create Schedule"
IVSWikiBlue (talk | contribs) (Created page with "This API call will add a new schedule. ===Resource URL=== <pre>http://valt.example.com/api/v3/schedule</pre> ===Resource Information=== {|class="wikitable" |'''Method''' |PO...") |
(No difference)
|
Latest revision as of 14:06, 14 April 2020
This API call will add a new schedule.
Contents
Resource URL
http://valt.example.com/api/v3/schedule
Resource Information
Method | POST |
Headers | Content-Type:application/json |
Response Type | JSON |
Authentication Required | Yes |
Parameters
The JSON body must be properly formatted. All fields and values should be enclosed in double quotes and separated by a colon.
Field Name | Description | Required | Example | ||
---|---|---|---|---|---|
name | Schedule Name | yes | Monday Weekly | ||
room | Room ID | yes | 4 | ||
start_at | Start time (epoch time) Must be in the future | yes | 1570011010 | ||
duration | Schedule duration in seconds | yes | 300 | ||
template | Metadata fields to populate | no | {17:"Student"} | ||
{fieldid} | Metadata field value | no | Student | ||
recurrence | Reoccurring schedule configuration | no | |||
type | Recurring Schedule Type (Valid Values: weekly, monthly, daily, none) | no | weekly | ||
weeks_range | Days of the week the schedule will recur (0-6, 0=Sunday) | no | 1 | ||
range_type | When will recurring schedule end (Valid Value: no = no end date, after = fixed number of occurrences, by = will end of specified date) | no | no | ||
end_after | Number of Occurrences | no | 10 | ||
end_by | Date to end schedule on. | no | 04-30-2020 | ||
share | Videos created by this schedule will be shared with these users. | no | {"users":"13,17,43","users_groups":"1,7,12"} | ||
users | List of user IDs videos created by this schedule will be shared with. | no | 13,17,43 | ||
user_groups | List of group IDs videos created by this schedule will be shared with. | no | 1,7,12 |
Response
Code | Reason |
---|---|
200 | Schedule Created Successfully |
400 | Invalid Request (See Response for Specific Error) |
401 | Unauthorized |
500 | JSON Body Formatted Incorrectly |
The call returns an array containing the schedule ID.
Examples
Request
The sample JSON body below is formatted with line breaks and indentation to make it easier to read. This is not required.
https://ivstest1.ad.ipivs.com/api/v3/schedule?access_token=e82632d19c523678fea3d1016c6df9e9
{ "name":"API Schedule 1", "room":39, "start_at":"1586636900", "duration":"300" }
Successful Response
Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.
[ 3 ]
Failure Response
Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.
{ "data":{ "message": "Validation Error", "fields":[ { "name": "name", "message": "This value should not be blank." } ] }, "code": 400 }