Content Access
Methods for accessing content types, libraries and objects
AccessInfo
objectId,
args // optional
}) → Promise.<Object>
Retrieve info about the access charge and permissions for the specified object.
Note: Access charge is specified in ether
Returns: Info about the access charge and whether or not the object is accessible to the current user
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ✓ | ID of the object |
args | object | Arguments to the getAccessInfo method - See the base content contract |
AccessRequest
libraryId, // optional
objectId, // optional
versionHash, // optional
args, // optional
update, // optional
noCache // optional
}) → Promise.<Object>
Make an explicit call to accessRequest or updateRequest of the appropriate contract. Unless noCache is specified on this method or on the client, the resultant transaction hash of this method will be cached for all subsequent access to this contract.
Note: Access and update requests are handled automatically by ElvClient. Use this method only if you need to make an explicit call. For example, if you need to specify custom arguments to access a content object, you can call this method explicitly with those arguments. Since the result is cached (by default), all subsequent calls to that content object will be authorized with that AccessRequest transaction.
Note: If the access request has an associated charge, this charge will be determined and supplied automatically.
Returns: Resultant AccessRequest or UpdateRequest event
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Version hash of the object | |
args | Array | Custom arguments to the accessRequest or updateRequest methods (default:[) | |
update | boolean | If true, will call updateRequest instead of accessRequest (default:false) | |
noCache | boolean | If true, the resultant transaction hash will not be cached for future use (default:false) |
AccessType
Return the type of contract backing the specified ID
Returns: Contract type of the item - "space", "library", "type", "object", "wallet", "group", or "other"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | ID of the item |
AssetMetadata
libraryId, // optional
objectId, // optional
versionHash, // optional
metadata, // optional
localization,
produceLinkUrls // optional
}) → Promise.<Object>
Retrive public/asset_metadata from the specified object, performing automatic localization override based on the specified localization info.
File and rep links will have urls generated automatically within them (See the produceLinkUrls parameter in ContentObjectMetadata)
Returns: public/asset_metadata of the specified object, overwritten with specified localization
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Version of the object -- if not specified, latest version is used | |
metadata | Object | If you have already retrieved metadata for the object and just want to perform localization, the metadata (Starting from public/asset_metadata) can be provided to avoid re-fetching the metadata. | |
localization | Array | ✓ | A list of locations of localized metadata, ordered from highest to lowest priority |
produceLinkUrls | boolean | If specified, file and rep links will automatically be populated with a full URL (default:false) |
AuditContentObject
libraryId, // optional
objectId, // optional
versionHash, // optional
salt, // optional
samples, // optional
authorizationToken // optional
}) → Promise.<Object>
Audit the specified content object against several content fabric nodes
Returns: Response describing audit results
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Version hash of the object -- if not specified, latest version is returned | |
salt | string | base64-encoded byte sequence for salting the audit hash | |
samples | Array.<number> | list of percentages (0.0 - <1.0) used for sampling the content part list, up to 3 | |
authorizationToken | string | Additional authorization token for this request |
AvailableDRMs
Determine available DRM types available in this browser environment.
AvailableOfferings
objectId, // optional
versionHash, // optional
writeToken, // optional
linkPath, // optional
signedLink, // optional
directLink, // optional
handler, // optional
authorizationToken // optional
) → Promise.<Object>
Retrieve available playout offerings for the specified content
Returns: The available offerings
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ID of the content | |
versionHash | string | Version hash of the content | |
writeToken | string | Write token for the content | |
linkPath | string | If playing from a link, the path to the link | |
signedLink | boolean | Specify if linkPath is referring to a signed link | |
directLink | boolean | Specify if linkPath is pointing directly to the offerings endpoint | |
handler | string | The handler to use for playout (not used with links) (default:playout) | |
authorizationToken | Object | Additional authorization token for authorizing this request |
BitmovinPlayoutOptions
objectId, // optional
versionHash, // optional
writeToken, // optional
linkPath, // optional
signedLink, // optional
protocols,
drms,
handler, // optional
offering, // optional
playoutType, // optional
context, // optional
authorizationToken, // optional
options // optional
})
Retrieve playout options in BitMovin player format for the specified content that satisfy the given protocol and DRM requirements
If only objectId is specified, latest version will be played. To retrieve playout options for a specific version of the content, provide the versionHash parameter (in which case objectId is unnecessary)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ID of the content | |
versionHash | string | Version hash of the content | |
writeToken | string | Write token for the content | |
linkPath | string | If playing from a link, the path to the link | |
signedLink | boolean | Specify if linkPath is referring to a signed link | |
protocols | Array.<string> | ✓ | Acceptable playout protocols ("dash", "hls") (default:["dash","hls"]) |
drms | Array.<string> | ✓ | Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine") |
handler | string | The handler to use for playout (default:playout) | |
offering | string | The offering to play (default:default) | |
playoutType | string | The type of playout | |
context | Object | Additional audience data to include in the authorization request
| |
authorizationToken | Object | Additional authorization token for authorizing this request | |
options | Object | Additional query parameters to pass when requesting available playout options, such as clipping parameters. |
CallBitcodeMethod
libraryId, // optional
objectId, // optional
versionHash, // optional
writeToken, // optional
method,
verb,
queryParams, // optional
body, // optional
headers, // optional
constant, // optional
format // optional
}) → Promise.<format>
Call the specified bitcode method on the specified object
Returns: The response from the call in the specified format
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Hash of the object version - if not specified, latest version will be used | |
writeToken | string | Write token of an object draft - if calling bitcode of a draft object | |
method | string | ✓ | Bitcode method to call |
verb | string | ✓ | HTTP verb (GET, POST, PUT, DELETE, ...) |
queryParams | Object | Query parameters to include in the request | |
body | Object | Request body to include, if calling a non-constant method | |
headers | Object | Request headers to include | |
constant | boolean | If specified, a GET request authenticated with an AccessRequest will be made. Otherwise, a POST with an UpdateRequest will be performed (default:true) | |
format | string | The format of the response (default:json) |
Collection
Get a list of unique addresses of all of the specified type the current user has access to through both their user wallet and through access groups
Returns: List of addresses of available items
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
collectionType | string | ✓ | Type of collection to retrieve
|
ContentLibraries
List content libraries - returns a list of content library IDs available to the current user
ContentLibrary
Returns information about the content library
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ✓ |
ContentLibraryOwner
Returns the address of the owner of the specified content library
Returns: The account address of the owner
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ✓ |
ContentObject
objectId, // optional
versionHash, // optional
writeToken // optional
}) → Promise.<Object>
Get info about a specific content object
Returns: Description of content object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ID of the object | |
versionHash | string | Version hash of the object -- if not specified, latest version is returned | |
writeToken | string | Write token for an object draft -- if supplied, versionHash will be ignored |
ContentObjectAccessComplete
objectId,
score
}) → Promise.<Object>
Call accessComplete on the specified content object contract using a previously cached requestID. Caching must be enabled and an access request must have been previously made on the specified object by this client instance.
Returns: Transaction log of the AccessComplete event
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ✓ | ID of the object |
score | number | ✓ | Percentage score (0-100) |
ContentObjectGraph
libraryId, // optional
objectId, // optional
versionHash, // optional
autoUpdate, // optional
select // optional
}) → Promise.<Object>
Get a specific content object in the library
Returns: Description of created object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Version hash of the object -- if not specified, latest version is returned | |
autoUpdate | boolean | If true, lists only links marked as auto-update links (default:false) | |
select | string | Array.<string> | Limit metadata fields return in link details |
ContentObjectImageUrl
libraryId, // optional
objectId, // optional
versionHash, // optional
height, // optional
imagePath // optional
}) → Promise.<(string|undefined)>
Get the image URL for the specified object
Returns: If the object has an image, will return a URL for that image.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Version hash of the object -- if not specified, latest version is used | |
height | number | If specified, the image will be scaled to the specified maximum height | |
imagePath | string | Metadata path to the image link (default:public/display_image) |
ContentObjectLibraryId
objectId, // optional
versionHash // optional
}) → Promise.<string>
Retrieve the library ID for the specified content object
Returns: Library ID of the object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ID of the object | |
versionHash | string | Version hash of the object |
ContentObjectMetadata
libraryId, // optional
objectId, // optional
versionHash, // optional
writeToken, // optional
metadataSubtree, // optional
queryParams, // optional
select, // optional
remove, // optional
authorizationToken, // optional
noAuth, // optional
resolveLinks, // optional
resolveIncludeSource, // optional
resolveIgnoreErrors, // optional
linkDepthLimit, // optional
produceLinkUrls // optional
}) → Promise.<(Object|string)>
Get the metadata of a content object
Returns: Metadata of the content object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ID of the library | |
objectId | string | ID of the object | |
versionHash | string | Version of the object -- if not specified, latest version is used | |
writeToken | string | Write token of an object draft - if specified, will read metadata from the draft | |
metadataSubtree | string | Subtree of the object metadata to retrieve | |
queryParams | Object | Additional query params for the call (default:{}) | |
select | Array.<string> | Limit the returned metadata to the specified attributes
| |
remove | Array.<string> | Exclude the specified items from the retrieved metadata | |
authorizationToken | string | Additional authorization token for this request | |
noAuth | string | If specified, the normal authorization flow will be skipped. Useful if you know the metadata you're retrieving is publicly accessible (default:false) | |
resolveLinks | boolean | If specified, links in the metadata will be resolved (default:false) | |
resolveIncludeSource | boolean | If specified, resolved links will include the hash of the link at the root of the metadata Example: false) | |
resolveIgnoreErrors | boolean | If specified, link errors within the requested metadata will not cause the entire response to result in an error (default:false) | |
linkDepthLimit | number | Limit link resolution to the specified depth. Default link depth is 1 (only links directly in the object's metadata will be resolved) (default:1) | |
produceLinkUrls | boolean | If specified, file and rep links will automatically be populated with a full URL (default:false) |
ContentObjectOwner
objectId, // optional
versionHash // optional
}) → Promise.<string>
Returns the address of the owner of the specified content object
Returns: The account address of the owner
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ID of the object | |
versionHash | string | Version hash of the object |
ContentObjects
libraryId,
filterOptions // optional
}) → Promise.<Array.<Object>>
List content objects in the specified library
Returns: List of objects in library
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ✓ | ID of the library |
filterOptions | object | Pagination, sorting and filtering options | |
filterOptions.start | number | Start index for pagination | |
filterOptions.limit | number | Max number of objects to return | |
filterOptions.sort | Array.<string> | string | Sort by the specified key(s) | |
filterOptions.sortDesc | boolean | Sort in descending order | |
filterOptions.select | Array.<string> | string | Include only the specified metadata keys (all must start with /public) | |
filterOptions.filter | Array.<object> | object | Filter objects by metadata | |
filterOptions.filter.key | string | Key to filter on (must start with /public) | |
filterOptions.filter.type | string | Type of filter to use for the specified key:
| |
filterOptions.filter.filter | string | Filter for the specified key |
ContentObjectTenantId
objectId, // optional
versionHash // optional
}) → Promise.<string>
Retrieve the tenant ID associated with the specified content object
Returns: Tenant ID of the object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ID of the object | |
versionHash | string | Version hash of the object |
ContentObjectVersions
libraryId,
objectId
}) → Promise.<Object>
List the versions of a content object
Returns: Response containing versions of the object
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ✓ | ID of the library |
objectId | string | ✓ | ID of the object |
ContentSpaceId
Get the ID of the current content space
Returns: contentSpaceId - The ID of the current content space
ContentType
name, // optional
typeId, // optional
versionHash, // optional
publicOnly // optional
}) → Promise.<Object>
Find the content type accessible to the current user by name, ID, or version hash
Returns: The content type, if found
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Name of the content type to find | |
typeId | string | ID of the content type to find | |
versionHash | string | Version hash of the content type to find | |
publicOnly | boolean | If specified, will only retrieve public metadata (no access request needed) (default:false) |
ContentTypeOwner
name, // optional
typeId, // optional
versionHash // optional
}) → Promise.<string>
Returns the address of the owner of the specified content type
Returns: The account address of the owner
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Name of the content type to find | |
typeId | string | ID of the content type to find | |
versionHash | string | Version hash of the content type to find |
ContentTypes
List all content types accessible to this user.
Returns: Available content types
Decrypt
libraryId,
objectId,
writeToken,
chunk
}) → Promise.<ArrayBuffer>
Decrypt the specified chunk for the specified object or draft
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ✓ | ID of the library |
objectId | string | ✓ | ID of the object |
writeToken | string | ✓ | Write token of the content object draft |
chunk | ArrayBuffer | Buffer | ✓ | The data to decrypt |
DefaultKMSAddress
Get the address of the default KMS of the content space or the provided tenant
Returns: Address of the KMS
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
tenantId | string | An ID of a tenant contract - if not specified, the content space contract will be used |
EmbedUrl
objectId,
versionHash,
duration,
mediaType, // optional
options
}) → Promise.<string>
Get an embed URL for the specified object
Returns: Will return an embed URL
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | ✓ | ID of the object |
versionHash | string | ✓ | Version hash of the object |
duration | number | ✓ | Time until the token expires, in milliseconds (1 day = 24 * 60 * 60 * 1000 = 86400000) |
mediaType | string | The type of the media. Available options:
video) | |
options | Object | ✓ | Additional video/player options
|
Encrypt
libraryId,
objectId,
writeToken,
chunk
}) → Promise.<ArrayBuffer>
Encrypt the specified chunk for the specified object or draft
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
libraryId | string | ✓ | ID of the library |
objectId | string | ✓ | ID of the object |
writeToken | string | ✓ | Write token of the content object draft |
chunk | ArrayBuffer | Buffer | ✓ | The data to encrypt |
EncryptionConk
libraryId,
objectId,
versionHash,
writeToken, // optional
download // optional
})
Retrieve the encryption conk for the specified object. If one has not yet been created and a writeToken has been specified, this method will create a new conk and save it to the draft metadata
Returns: Promise