Difference between revisions of "API Upload Recording"
IVSWikiBlue (talk | contribs) |
IVSWikiBlue (talk | contribs) |
||
Line 88: | Line 88: | ||
} | } | ||
} | } | ||
+ | </nowiki> | ||
+ | |||
+ | ===Successful Response=== | ||
+ | Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks. | ||
+ | <nowiki> | ||
+ | { | ||
+ | "id": "1bc87bea-9412-43f1-9e95-dbad0e60c99a", | ||
+ | "videos":[ | ||
+ | "198016d2-edf4-4eaa-aa84-1545b07270e2" | ||
+ | ] | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | ===Failure Responses=== | ||
+ | Sample responses are shown with line breaks to make it more readable. Actual responses will not include line breaks. | ||
+ | <nowiki> | ||
+ | { | ||
+ | "error":{ | ||
+ | "code":500, | ||
+ | "message":"Internal Server Error" | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | <nowiki> | ||
+ | { | ||
+ | "error":{ | ||
+ | "code":401, | ||
+ | "message":"No API token provided" | ||
+ | } | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | <nowiki> | ||
+ | { | ||
+ | "error":{ | ||
+ | "code": 401, | ||
+ | "message": "Bad credentials." | ||
+ | } | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | |||
+ | =2) Upload Video to Record= | ||
+ | ===Resource URL=== | ||
+ | <pre>http://valt.example.com/api/v3/records/{recordID}/videos/{videoID}</pre> | ||
+ | |||
+ | ===Resource Information=== | ||
+ | {|class="wikitable" | ||
+ | |'''Method''' | ||
+ | |POST | ||
+ | |- | ||
+ | |'''Response Type''' | ||
+ | |multipart/form-data | ||
+ | |- | ||
+ | |'''Authentication Required''' | ||
+ | |Yes | ||
+ | |} | ||
+ | |||
+ | ===Parameters=== | ||
+ | {|class="wikitable" | ||
+ | |+Headers | ||
+ | !colspan="2"|data | ||
+ | |- | ||
+ | |colspan="2"|'''content-type''' | ||
+ | |multipart/form-data | ||
+ | |- | ||
+ | |colspan="2"|'''content-range''' | ||
+ | |bytes 0-316620/316620 | ||
+ | |} | ||
+ | |||
+ | {|class="wikitable" | ||
+ | |+JSON Response | ||
+ | !colspan="3"|data | ||
+ | |- | ||
+ | |colspan="2"|'''name''' | ||
+ | |Recording Name | ||
+ | |- | ||
+ | |colspan="2"|'''template''' | ||
+ | |Array of additional information template fields. | ||
+ | |- | ||
+ | |colspan="2"|'''share''' | ||
+ | | | ||
+ | |- | ||
+ | | | ||
+ | |'''groups''' | ||
+ | |Array of group IDs the video is shared with in addition to default video permissions. | ||
+ | |- | ||
+ | | | ||
+ | |'''users''' | ||
+ | |Array of user IDs the video is shared with in addition to default video permissions. | ||
+ | |} | ||
+ | |||
+ | ===Response=== | ||
+ | |||
+ | {|class="wikitable" | ||
+ | !Code | ||
+ | !Reason | ||
+ | |- | ||
+ | |200 | ||
+ | |Request Successful | ||
+ | |- | ||
+ | |401 | ||
+ | |Unauthorized | ||
+ | |- | ||
+ | |500 | ||
+ | |Internal Server Error | ||
+ | |} | ||
+ | |||
+ | {|class="wikitable" | ||
+ | |+JSON Response | ||
+ | !colspan="2"|data | ||
+ | |- | ||
+ | |'''url''' | ||
+ | |Download URL | ||
+ | |} | ||
+ | |||
+ | ==Examples== | ||
+ | ===Request=== | ||
+ | <pre>https://ivssvdev1.ad.ipivs.com/api/v3/records/1bc87bea-9412-43f1-9e95-dbad0e60c99a/videos/198016d2-edf4-4eaa-aa84-1545b07270e2?access_token=2407c9d2cfde75c49e5d356ee9f83422</pre> | ||
+ | ====Headers==== | ||
+ | <nowiki> | ||
+ | "Content-Type": "multipart/form-data" | ||
+ | "Content-Range": "bytes 0-316620/316620" | ||
+ | </nowiki> | ||
+ | ====Body==== | ||
+ | <nowiki> | ||
+ | file [File] = {Video File} | ||
</nowiki> | </nowiki> | ||
Revision as of 17:00, 7 May 2025
This API is a two-part request that creates a video record and then uploads a video file to the specified record.
1) Create Upload Record
Resource URL
http://valt.example.com/api/v3/records/create-upload
Resource Information
Method | POST |
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.
data | ||
---|---|---|
name | Recording Name | |
template | Array of additional information template fields. | |
share | ||
groups | Array of group IDs the video is shared with in addition to default video permissions. | |
users | Array of user IDs the video is shared with in addition to default video permissions. |
Response
Code | Reason |
---|---|
200 | Request Successful |
401 | Unauthorized |
500 | Internal Server Error |
data | |
---|---|
url | Download URL |
Examples
Request
https://ivssvdev1.ad.ipivs.com/api/v3/records/create-upload?access_token=2407c9d2cfde75c49e5d356ee9f83422
Example 1
{ "name": "Upload Recording" }
Example 2
{ "name": "Upload Recording", "template": { "1": "Field Value 1", "2": "Field Value 2", }, "share": { "users": [1, 2, 3], "groups": [4, 5, 6] } }
Successful Response
Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.
{ "id": "1bc87bea-9412-43f1-9e95-dbad0e60c99a", "videos":[ "198016d2-edf4-4eaa-aa84-1545b07270e2" ] }
Failure Responses
Sample responses are shown with line breaks to make it more readable. Actual responses will not include line breaks.
{ "error":{ "code":500, "message":"Internal Server Error" }
{ "error":{ "code":401, "message":"No API token provided" } }
{ "error":{ "code": 401, "message": "Bad credentials." } }
2) Upload Video to Record
Resource URL
http://valt.example.com/api/v3/records/{recordID}/videos/{videoID}
Resource Information
Method | POST |
Response Type | multipart/form-data |
Authentication Required | Yes |
Parameters
data | ||
---|---|---|
content-type | multipart/form-data | |
content-range | bytes 0-316620/316620 |
data | ||
---|---|---|
name | Recording Name | |
template | Array of additional information template fields. | |
share | ||
groups | Array of group IDs the video is shared with in addition to default video permissions. | |
users | Array of user IDs the video is shared with in addition to default video permissions. |
Response
Code | Reason |
---|---|
200 | Request Successful |
401 | Unauthorized |
500 | Internal Server Error |
data | |
---|---|
url | Download URL |
Examples
Request
https://ivssvdev1.ad.ipivs.com/api/v3/records/1bc87bea-9412-43f1-9e95-dbad0e60c99a/videos/198016d2-edf4-4eaa-aa84-1545b07270e2?access_token=2407c9d2cfde75c49e5d356ee9f83422
Headers
"Content-Type": "multipart/form-data" "Content-Range": "bytes 0-316620/316620"
Body
file [File] = {Video File}
Successful Response
Sample response is shown with line breaks to make it more readable. Actual responses will not include line breaks.
{ "id": "1bc87bea-9412-43f1-9e95-dbad0e60c99a", "videos":[ "198016d2-edf4-4eaa-aa84-1545b07270e2" ] }
Failure Responses
Sample responses are shown with line breaks to make it more readable. Actual responses will not include line breaks.
{ "error":{ "code":500, "message":"Internal Server Error" }
{ "error":{ "code":401, "message":"No API token provided" } }
{ "error":{ "code": 401, "message": "Bad credentials." } }