Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

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)

  1. The client makes a POST call to the /Sessions/ endpoint with the following Content-Type value: 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).
    1. 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.
  2. The client begins uploading the webpage HTML file by calling PUT on the /Sessions/{SessionToken}/Uploads/{UploadToken}/ endpoint with the following Content-Type value: application/vnd.bsn.start.webpage.asset.upload.arguments.201701+json.
  3. The client uploads the file to the server by calling POST on the /Sessions/{SessionToken}/Uploads/{UploadToken}/chunks/ endpoint. If the file is larger than approximately 256KB, the client will need to make multiple POST calls and use the ?offset URL parameter to segment the file into chunks.
  4. Once the file chunk(s) have been uploaded, the client completes the HTML file upload by calling PUT on the /Sessions/{SessionToken}/Uploads/{UploadToken}/ endpoint with the following Content-Type value: application/vnd.bsn.complete.webpage.asset.upload.arguments.201701+json.
  5. The client repeats steps 2 through 4 for each asset file associated with the HTML file.
  6. Once all files have been uploaded, the client completes the webpage-upload session by calling PUT on the /Sessions/{SessionToken}/ endpoint with the following Content-Type: application/vnd.bsn.complete.webpage.upload.arguments.201701+json. The response body will include the new contentId values of the uploaded HTML and asset files.
Note
titleNote

All files must be specified in the initial POST call to the /Sessions/ endpoint (step 1). You cannot use the PUT /Sessions/{SessionToken}/ or POST /Sessions/{SessionToken}/Uploads/ calls to dynamically add or remove files from the webpage-upload session.


Endpoints:

Table of Contents
maxLevel3
indent20px
excludeUpload Workflow|Endpoints:


...