Content Service API

Content storage (upload) and retrieval (download) service

Operations

Operations


clear

Deletes all the content for the given context/solution

Responses
An array of the ids of the deleted content items - [ object ]
Name Type Description
id string The id of the content item
Error information - object
Name Type Description
type string The error message's type
message string The associated error message
Example
response.message = Content.clear()

delete

Delete the given content item

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
id string The ID of the content
Responses
The content item id - object
Name Type Description
id string The id of the content item
Error information - object
Name Type Description
type string The error message's type
message string The associated error message
Example
response.message = Content.delete({
  id = 'image.png',
})

download

Get the download URL for the specified content item

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
id string The ID of the content
expires_in string Time in seconds download URL is valid
Responses
HTTP information for client-side content downloads - object
Name Type Description
id string The id of the content item
url string The URL to use
method "GET" The HTTP method to use with this URL
Error information - object
Name Type Description
type string The error message's type
message string The associated error message
Example
response.message = Content.download({
  id = 'image.png',
  expires_in = 600,
})

info

Retrieve metadata and tags associated with uploaded content

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
id string The ID of the content
Responses
A content item's metadata and tags - object
Name Type Description
id string The id of the content item
tags object Tags and their values for the content item
type string The mime type of the content item
length integer The content item's length in bytes
last_modified string(dateTime) Last modified timestamp (formatted as ISO 8601)
Error information - object
Name Type Description
type string The error message's type
message string The associated error message
Example
response.message = Content.info({
  id = 'image.png',
})

list

Get the list of content items for the solution

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
full boolean Return complete content items instead of the id only.
Responses
An array of content items - [ object ]
Name Type Description
id string The id of the content item
tags object Tags and their values for the content item
type string The mime type of the content item
length integer The content item's length in bytes
last_modified string(dateTime) Last modified timestamp (formatted as ISO 8601)
Error information - object
Name Type Description
type string The error message's type
message string The associated error message
Example
response.message = Content.list({
  full = true,
})

upload

Get the upload URL for the specified content item. The content ID will be generated if not supplied, and can be generated using the key, if provided

Arguments
parameters - object - Object containing service call parameters.
Name Type Description
id string The ID of the content
sha256 string The sha256 sum of the content to upload
type string The content's type
expires_in string Time in seconds upload URL is valid
tags string Urlencoded json { "key": "value" } pairs
Responses
HTTP information for client-side content uploads - object
Name Type Description
id string The id of the content item
url string The URL to use
field string The name of the part containing upload data (must be LAST)
inputs object Additional parts expected with the upload
method "POST" The HTTP method to use with this URL
enctype string The expected form-data encoding to use
Error information - object
Name Type Description
type string The error message's type
message string The associated error message
Example
response.message = Content.upload({
  id = 'image.png',
  type = 'image/png',
  expires_in = 600,
})