...
...
...
...
Use this endpoint to upload files to the network. Webpages are uploaded as a collection of files in an upload session, while all other files are uploaded individually without a session marker.
Calls to the /Sessions/
endpoints require unique Accept and Content-Type header values (outlined below). Failing to include these header values will prompt a code 406 response from the server. Unlike other BSN REST endpoints, the upload URL contains the "Upload" path before the API version.
Base URL for these endpoints: https://api.brightsignnetwork.com/Upload/2017/01/REST/Sessions/
Upload Workflow
Webpages
These steps outline how to upload a webpage (i.e. an HTML file and associated asset files)
- The client makes a POST call to the
/
endpoint with the following Content-Type value:S
essions/application/vnd.bsn.start.webpage.upload.arguments.201701+json
. The POST request body includes information about the HTML file and associated asset files (including the path of each asset file relative to the HTML file).- The response body includes a token for the webpage-upload session, as well as an upload token for each file that is part of the webpage.
- The client begins uploading the webpage HTML file by calling PUT on the
/
endpoint with the following Content-Type value:S
essions/{S
essionToken}/Uploads/{U
ploadToken}/application/vnd.bsn.start.webpage.asset.upload.arguments.201701+json
. - The client uploads the file to the server by calling POST on the
/
endpoint. If the file is larger than approximately 256KB, the client will need to make multiple POST calls and use theS
essions/{S
essionToken}/U
ploads/{U
ploadToken}/chunks/?offset
URL parameter to segment the file into chunks. - Once the file chunk(s) have been uploaded, the client completes the HTML file upload by calling PUT on the
/
endpoint with the following Content-Type value:S
essions/{S
essionToken}/U
ploads/{U
ploadToken}/application/vnd.bsn.complete.webpage.asset.upload.arguments.201701+json
. - The client repeats steps 2 through 4 for each asset file associated with the HTML file.
- Once all files have been uploaded, the client completes the webpage-upload session by calling PUT on the
/
endpoint with the following Content-Type:S
essions/{S
essionToken}/application/vnd.bsn.complete.webpage.upload.arguments.201701+json
. The response body will include the newcontentId
values of the uploaded HTML and asset files.
Note | ||
---|---|---|
| ||
All files must be specified in the initial POST call to the |
Endpoints:
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Individual Files
These steps outline how to upload a single, independent file (such as a content file or plugin script).
- The client makes a POST call to the
/
endpoint with the following Content-Type value:S
essions/None/Uploads/application/vnd.bsn.start.content.upload.arguments.201701+json
. The POST request body includes information about the file.- The response body includes an upload token for the file.
- The client uploads the file to the server by calling POST on the
/
endpoint. If the file is larger than approximately 256KB, the client will need to make multiple POST calls and use theS
essions/None/Uploads/{UploadToken}/chunks/?offset
URL parameter to segment the file into chunks. - The client completes the upload by calling PUT on the
/
endpoint with the following Content-Type value:S
essions/None/Uploads/{UploadToken}/application/vnd.bsn.complete.content.upload.arguments.201701+json
.
Note | ||
---|---|---|
| ||
Unlike other endpoints, the |
GET
Retrieves currently active webpage-upload sessions.
Parameters
marker
: A value specifying which page to retrieve. This value is useful if theisTruncated
entry in the response body of the previous GET call indicates that the number of WebpageUploadStatus instances exceeds thepageSize
.filter
: An expression for filtering search results.pageSize
: The maximum number of WebpageUploadStatus instances that can be contained in the response body
Headers
Accept: application/vnd.bsn.webpage.upload.status.pagedlist.201701+json
Response Body
...
"unknown"
"queued"
"started"
"uploading"
"stopped"
"uploaded"
"verified"
"cancelled"
"corrupted"
"collected"
"terminated"
"completed"
...
[int] count
: The number of chunks with the specifiedlength
andstate
. A zero value is used for the section of the file that has not been uploaded/queued yet.[int] length
: The byte length of the chunk(s)[string] state
: The 6545163 of the chunk(s)
...
POST
Creates a new webpage-upload session for the webpage and its asset files. This operation returns a token for the entire webpage-upload session, as well as a token for each asset-file upload.
Headers
Content-Type: application/vnd.bsn.start.webpage.upload.arguments.201701+json
-or- application/vnd.bsn.start.webpage.update.arguments.201701+json
Accept: application/vnd.bsn.webpage.upload.status.201701+json, application/vnd.bsn.error+json
Request Body
...
"Auto"
"Text"
"Image"
"Video"
"Audio"
"Webpage"
"DeviceWebpage"
...
Response Body
...
...
...
...
...
...
[int] count
: The order of the chunk in the sequence[int] length
: The length (in bytes) of the chunk[string] state
: The 6545163 of the chunk.
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Headers
Content-Type: application/vnd.bsn.complete.webpage.upload.arguments.201701+json
Request Bobdy
...
...
...
...
...
...
...
...
...
...
...
...
Headers
Accept: application/vnd.bsn.content.upload.status.pagedlist.201701+json, application/vnd.bsn.error+json
Response Body
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Headers
Accept: application/vnd.bsn.content.upload.status.201701+json
Response Body
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...