Upload API Endpoints (2019/03)
The Upload endpoints allow users to send files to the BSN.Cloud server.
Base URL for this endpoint: https://api.bsn.cloud/Upload/2019/03/REST
_________________________________________________________________________
DELETE /Sessions/{SessionToken}/
Cancels the specified Content Upload Session
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session Token generated by the server
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- SessionToken is set to WIxMjM0NTY3ODkwIiwibmF
DELETE /Upload/2019/03/REST/Sessions/WIxMjM0NTY3ODkwIiwibmF/ HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
If-Unmodified-Since: Wed, 20 Dec 2024 21:32:34 GMT
Accept: application/vnd.bsn.error+json
Accept-Encoding: gzip,deflate______________________________________________________________
Success Response
204: The specified Content Upload Session was successfully cancelled
Failure Response
401: The access token is invalid or not specified
403: The supplied access token, though valid, doesn't provide access to this method
404: The Content Upload Session with specified session token was not found
412: The current Content Upload Session state has different timestamp than specified in request
5XX: Any 500 code is an internal server error
POST /Sessions/{SessionToken}/Uploads/
Creates a new Content Upload either in scope of the specified Content Upload Session or standalone
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session token generated by the server or None if the new Content Upload is standalone
______________________________________________________________
Request Body
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- SessionToken is set to WIxMjM0NTY3ODkwIiwibmF
Content Upload Example
POST /Upload/2019/03/REST/Sessions/WIxMjM0NTY3ODkwIiwibmF/Uploads/ HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
Accept: application/vnd.bsn.content.upload.status.201903+json, application/vnd.bsn.content.upload.negotiation.status.201903+json, application/vnd.bsn.error+json
Accept-Encoding: gzip,deflateThis request supports multiple payload representations for the different use cases:
- The application/vnd.bsn.start.content.upload.arguments.201903+json representation is used to start the new Content Entity (2022/06) upload as shown in the example below:
Content-Type: application/vnd.bsn.start.content.upload.arguments.201903+json
Content-Length: 277
{
"sessionToken": null,
"uploadToken": null,
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.start.content.update.arguments.201903+json representation is used to modify the previously uploaded Content Entity (2022/06) as shown in the example below:
Content-Type: application/vnd.bsn.start.content.update.arguments.201903+json
Content-Length: 300
{
"sessionToken": null,
"uploadToken": null,
"contentId": 12345,
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.start.webpage.asset.upload.arguments.201903+json representation is used to modify the previously uploaded WebPage Asset Entity (2022/06) as shown in the example below:
Content-Type: application/vnd.bsn.start.webpage.asset.upload.arguments.201903+json
Content-Length: 371
{
"sessionToken": "271e6422-704f-4c6f-b6dc-60c17a00f0fc",
"uploadToken": null,
"webPageAssetId": 0,
"relativePath": "/assets/text/",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "",
"fileThumb": null,
"tags": {}
}______________________________________________________________
Success Response Body
201: Returns the URI and timestamp of the ContentUploadStatus (2019/03) entity
Examples
This response supports multiple payload representations for the different use cases:
- The application/vnd.bsn.content.upload.status.201903+json representation of the ContentUploadStatus (2019/03) which is used for uploads of content which doesn't have equivalents in the destination folder:
{
"sessionToken": "",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 0,
"fileName": "Hello World.txt",
"fileSize": 12,
"shA1Hash": "",
"state": "Started",
"startTime": "2025-08-26T23:47:37.937Z",
"endTime": null,
"lastActivityTime": "2025-08-26T23:47:37.937Z",
"chunks": [
{
"count": 0,
"length": 12,
"state": "Uploading"
}
]
}- The application/vnd.bsn.content.upload.negotiation.status.201903+json representation of the ContentNegotiationStatus (2019/03) which is used to indicate that there is equivalent content in the destination folder and provide details about it:
{
"sessionToken": "",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 0,
"fileName": "Hello World.txt",
"fileSize": 12,
"shA1Hash": "",
"state": "Started",
"startTime": "2025-08-26T23:47:37.937Z",
"endTime": null,
"lastActivityTime": "2025-08-26T23:47:37.937Z",
"chunks": null,
"matchingFiles": [
{
"id": 12345,
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Text",
"fileSize": 12,
"shA1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"uploadDate": "2025-08-05T16:30:15.003Z"
}
]
}Failure Response
300: The acceptable Content Upload representations are not specified
400: The specified Content Upload Arguments are incomplete or not acceptable
401: The access token is invalid or not specified
404: The Content Upload Session with specified session token was not found
406: The specified representaion of Content Upload entity is not acceptable
415: The specified representaion of Content Upload Arguments is invalid or not supported
5XX: Any 500 code is an internal server error
GET /Sessions/{SessionToken}/Uploads/{UploadToken}/
Retrieves the status of specified Content Upload
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session Token generated by the server or None if the new Content Upload is standalone
- UploadToken string: The Upload Token generated by the server
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- SessionToken is set to None
- UploadToken is set to 321e6fc1-553f-4bb0-8c7a-d5bf859be6b2
GET /Upload/2019/03/REST/Sessions/None/Uploads/321e6fc1-553f-4bb0-8c7a-d5bf859be6b2/ HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
If-Modified-Since: Wed, 20 Dec 2024 21:32:34 GMT
Accept: application/vnd.bsn.content.upload.status.201903+json
Accept-Encoding: gzip,deflate______________________________________________________________
Success Response Body
200: The ContentUploadStatus (2019/03) was successfully retrieved
Example
{
"sessionToken": "",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 0,
"fileName": "Hello World.txt",
"fileSize": 12,
"shA1Hash": "",
"state": "Started",
"startTime": "2025-08-26T23:47:37.937Z",
"endTime": null,
"lastActivityTime": "2025-08-26T23:47:37.937Z",
"chunks": [
{
"count": 0,
"length": 12,
"state": "Uploading"
}
]
}Success Response
304: The timestamp specified in the request is the same or newer than the timestamp in the current Content Upload state
Failure Response
300: The acceptable Content Upload Session representations are not specified
401: The access token is invalid or not specified
404: A Content Upload Session with the specified session token was not found or the Content Upload with specified upload token was not found
406: The specified representation of the Content Upload Session entity is not acceptable
5XX: Any 500 code is an internal server error
PUT /Sessions/{SessionToken}/Uploads/{UploadToken}/
Updates the status of the specified Content Upload
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session Token generated by the server or None if the new Content Upload is standalone
- UploadToken string: The Content Upload Token generated by the server
______________________________________________________________
Request Body
- The ContentUploadArguments (2019/03) for a new content upload, or ContentUpdateArguments (2019/03) for editing the existing (previously uploaded) content, or WebPageAssetUploadArguments (2019/03) for a new webpage asset upload.
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- SessionToken is set to None
- UploadToken is set to 321e6fc1-553f-4bb0-8c7a-d5bf859be6b2
Content Upload, Start, and Complete Example
PUT /Upload/2019/03/REST/Sessions/None/Uploads/321e6fc1-553f-4bb0-8c7a-d5bf859be6b2/ HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
If-Unmodified-Since: Wed, 20 Dec 2024 21:32:34 GMT
Accept: application/vnd.bsn.content.upload.status.201903+json, application/vnd.bsn.content.upload.negotiation.status.201903+json, application/vnd.bsn.error+json
Accept-Encoding: gzip,deflateThis request supports multiple payload representations for the different use cases:
- The application/vnd.bsn.start.content.upload.arguments.201903+json representation is used to begin a @content entity upload within an ongoing session as shown in the example below:
Content-Type: application/vnd.bsn.start.content.upload.arguments.201903+json
Content-Length: 345
{
"sessionToken": "271e6422-704f-4c6f-b6dc-60c17a00f0fc",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.content.upload.arguments.201903+json representation is used to clarify an ongoing Content Entity (2022/06) upload as shown in the example below:
Content-Type: application/vnd.bsn.content.upload.arguments.201903+json
Content-Length: 351
{
"sessionToken": null,
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.complete.content.upload.arguments.201903+json representation is used to complete previously started Content Entity (2022/06) uploads as shown in the example below:
Content-Type: application/vnd.bsn.complete.content.upload.arguments.201903+json
Content-Length: 351
{
"sessionToken": null,
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.start.content.update.arguments.201903+json representation is used to start a new upload which modifies the previously uploaded Content Entity (2022/06) as shown in the example below:
Content-Type: application/vnd.bsn.content.update.arguments.201903+json
Content-Length: 368
{
"sessionToken": "271e6422-704f-4c6f-b6dc-60c17a00f0fc",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 12345,
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.content.update.arguments.201903+json representation is used to clarify an ongoing upload which modifies a previously uploaded Content Entity (2022/06) as shown in the example below:
Content-Type: application/vnd.bsn.start.content.update.arguments.201903+json
Content-Length: 374
{
"sessionToken": null,
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 12345,
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.complete.content.upload.arguments.201903+json representation is used to finish an upload which modifies the previously uploaded Content Entity (2022/06) as shown in the example below:
Content-Type: application/vnd.bsn.complete.content.upload.arguments.201903+json
Content-Length: 374
{
"sessionToken": null,
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 12345,
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.start.webpage.asset.upload.arguments.201903+json representation is used to show the status of a new WebPage Asset Entity (2022/06) upload as shown in the example below:
Content-Type: application/vnd.bsn.start.webpage.asset.upload.arguments.201903+json
Content-Length: 371
{
"sessionToken": "271e6422-704f-4c6f-b6dc-60c17a00f0fc",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"webPageAssetId": 0,
"relativePath": "/assets/text/",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.webpage.asset.upload.arguments.201903+json representation is used to clarify an ongoing WebPage Asset Entity (2022/06) upload as shown in the example below:
Content-Type: application/vnd.bsn.webpage.asset.upload.arguments.201903+json
Content-Length: 445
{
"sessionToken": "271e6422-704f-4c6f-b6dc-60c17a00f0fc",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"webPageAssetId": 0,
"relativePath": "/assets/text/",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"fileThumb": null,
"tags": {}
}- The application/vnd.bsn.complete.webpage.asset.upload.arguments.201903+json representation is used to complete previously started WebPage Asset Entity (2022/06) uploads as shown in the example below:
Content-Type: application/vnd.bsn.complete.webpage.asset.upload.arguments.201903+json
Content-Length: 445
{
"sessionToken": "271e6422-704f-4c6f-b6dc-60c17a00f0fc",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"webPageAssetId": 0,
"relativePath": "/assets/text/",
"fileName": "Hello World.txt",
"virtualPath": "\\Shared\\Unsorted\\",
"mediaType": "Auto",
"fileSize": 12,
"fileLastModifiedDate": "0001-01-01T00:00:00",
"sha1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"fileThumb": null,
"tags": {}
}______________________________________________________________
Success Response Body
200: Returns the ContentUploadStatus (2019/03)
Example
{
"sessionToken": "",
"uploadToken": "321e6fc1-553f-4bb0-8c7a-d5bf859be6b2",
"contentId": 0,
"fileName": "Hello World.txt",
"fileSize": 12,
"shA1Hash": "2EF7BDE608CE5404E97D5F042F95F89F1C232871",
"state": "Started",
"startTime": "2025-08-26T23:47:37.937Z",
"endTime": null,
"lastActivityTime": "2025-08-26T23:47:37.937Z",
"chunks": [
{
"count": 0,
"length": 12,
"state": "Uploading"
}
]
}Failure Response
300: The acceptable Content Upload Session representations are not specified
400: The specified Content Upload Session Arguments are incomplete or not acceptable
401: The access token is invalid or not specified
404: The Content Upload Session with the specified session token was not found or the Content Upload with specified upload token was not found
406: The specified representaion of the Content Upload Session entity is not acceptable
412: The current Content Upload Session state has different timestamp than specified in the request
415: The specified representaion of the Content Upload Session Arguments is invalid or not supported
5XX: Any 500 code is an internal server error
DELETE /Sessions/{SessionToken}/Uploads/{UploadToken}/
Cancels the specified Content Upload
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session Token generated by the server or None if the new Content Upload is standalone
- UploadToken string: The Content Upload Token generated by the server
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- SessionToken is set to None
- UploadToken is set to 321e6fc1-553f-4bb0-8c7a-d5bf859be6b2
DELETE /Upload/2019/03/REST/Sessions/None/Uploads/321e6fc1-553f-4bb0-8c7a-d5bf859be6b2/ HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
If-Unmodified-Since: Wed, 20 Dec 2024 21:32:34 GMT
Accept: application/vnd.bsn.error+json
Accept-Encoding: gzip,deflate______________________________________________________________
Success Response
204: The specified Content Upload was successfully cancelled
Failure Response
401: The access token is invalid or not specified
404: The Content Upload Session with specified session token was not found or the Content Upload with specified upload token was not found
412: The current Content Upload state has different timestamp than specified in request
5XX: Any 500 code is an internal server error
GET /Sessions/{SessionToken}/Uploads/{UploadToken}/Chunks/
Retrieves the status of Content Chunks in the specified active Content Upload
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session Token generated by the server or None if the new Content Upload is standalone
- UploadToken string: The Content Upload Token generated by the server
______________________________________________________________
Request Examples
The example request parameters and headers are set as follows:
- SessionToken is set to None
- UploadToken is set to 321e6fc1-553f-4bb0-8c7a-d5bf859be6b2
GET /Upload/2019/03/REST/Sessions/None/Uploads/321e6fc1-553f-4bb0-8c7a-d5bf859be6b2/Chunks/ HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
Accept: application/vnd.bsn.upload.content.chunk.status.list.201903+json
Accept-Encoding: gzip,deflate______________________________________________________________
Success Response Body
200: An array of ContentChunkStatus (2019/03) entities was successfully retrieved
Example
[
{
"count": 0,
"length": 12,
"state": "Uploading"
}
]Failure Response
300: The acceptable Content Upload Session representations are not specified
401: The access token is invalid or not specified
404: A Content Upload Session with the specified session token was not found or the Content Upload with specified upload token was not found
406: The specified representation of the Content Chunk entity is not acceptable
5XX: Any 500 code is an internal server error
POST /Sessions/{SessionToken}/Uploads/{UploadToken}/Chunks/
Uploads a new Content Chunk in scope of the specified ContentChunkStatus (2019/03)
______________________________________________________________
Query String Parameters
- offset string required: Start position of the current file part
______________________________________________________________
Segment
- SessionToken string: The Content Upload Session Token generated by the server or None if the new Content Upload is standalone
- UploadToken string: The Content Upload Token generated by the server
______________________________________________________________
Request Body
______________________________________________________________
Request Examples
The example request parameters and headers are set as follows:
- offset is set to 0
- SessionToken is set to None
- UploadToken is set to 321e6fc1-553f-4bb0-8c7a-d5bf859be6b2
POST /Upload/2019/03/REST/Sessions/None/Uploads/321e6fc1-553f-4bb0-8c7a-d5bf859be6b2/Chunks/?offset=0 HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
Accept: application/vnd.bsn.error+json
Accept-Encoding: gzip,deflate
Content-Type: application/octet-stream
Content-Length: 12This is the example request body:
Hello World!______________________________________________________________
Success Response
202: The specified Content Chunk has been successfully added to the queue
Failure Response
400: The specified Content Chunk data is incomplete or not acceptable
401: The access token is invalid or not specified
404: A Content Upload Session with the specified session token was not found or the Content Upload with specified upload token was not found
415: The specified Content Chunk format is invalid or not supported
5XX: Any 500 code is an internal server error