Skip to main content

Content Access

Methods for accessing content types, libraries and objects

AccessInfo

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

NameTypeRequiredDescription
objectIdstring

ID of the object

argsobject

Arguments to the getAccessInfo method - See the base content contract

AccessRequest

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version hash of the object

argsArray

Custom arguments to the accessRequest or updateRequest methods

(default: [)
updateboolean

If true, will call updateRequest instead of accessRequest

(default: false)
noCacheboolean

If true, the resultant transaction hash will not be cached for future use

(default: false)

AccessType

AccessType({ id }) → Promise.<string>

Return the type of contract backing the specified ID

Returns: Contract type of the item - "space", "library", "type", "object", "wallet", "group", or "other"

Parameters

NameTypeRequiredDescription
idstring

ID of the item

AssetMetadata

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version of the object -- if not specified, latest version is used

metadataObject

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.

localizationArray

A list of locations of localized metadata, ordered from highest to lowest priority

localization: [
["info_territories", "France", "FR"],
["info_locals", "FR"]
]
produceLinkUrlsboolean

If specified, file and rep links will automatically be populated with a full URL

(default: false)

AuditContentObject

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version hash of the object -- if not specified, latest version is returned

saltstring

base64-encoded byte sequence for salting the audit hash

samplesArray.<number>

list of percentages (0.0 - <1.0) used for sampling the content part list, up to 3

authorizationTokenstring

Additional authorization token for this request

AvailableDRMs

AvailableDRMs() → Promise.<Array.<string>>

Determine available DRM types available in this browser environment.

AvailableOfferings

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

NameTypeRequiredDescription
objectIdstring

ID of the content

versionHashstring

Version hash of the content

writeTokenstring

Write token for the content

linkPathstring

If playing from a link, the path to the link

signedLinkboolean

Specify if linkPath is referring to a signed link

directLinkboolean

Specify if linkPath is pointing directly to the offerings endpoint

handlerstring

The handler to use for playout (not used with links)

(default: playout)
authorizationTokenObject

Additional authorization token for authorizing this request

BitmovinPlayoutOptions

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

NameTypeRequiredDescription
objectIdstring

ID of the content

versionHashstring

Version hash of the content

writeTokenstring

Write token for the content

linkPathstring

If playing from a link, the path to the link

signedLinkboolean

Specify if linkPath is referring to a signed link

protocolsArray.<string>

Acceptable playout protocols ("dash", "hls")

(default: ["dash","hls"])
drmsArray.<string>

Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine")

handlerstring

The handler to use for playout

(default: playout)
offeringstring

The offering to play

(default: default)
playoutTypestring

The type of playout

contextObject

Additional audience data to include in the authorization request

  • Note: Context must be a map of string->string
authorizationTokenObject

Additional authorization token for authorizing this request

optionsObject

Additional query parameters to pass when requesting available playout options, such as clipping parameters.

CallBitcodeMethod

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Hash of the object version - if not specified, latest version will be used

writeTokenstring

Write token of an object draft - if calling bitcode of a draft object

methodstring

Bitcode method to call

verbstring

HTTP verb (GET, POST, PUT, DELETE, ...)

queryParamsObject

Query parameters to include in the request

bodyObject

Request body to include, if calling a non-constant method

headersObject

Request headers to include

constantboolean

If specified, a GET request authenticated with an AccessRequest will be made. Otherwise, a POST with an UpdateRequest will be performed

(default: true)
formatstring

The format of the response

(default: json)

Collection

Collection({ collectionType }) → Promise.<Array.<string>>

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

NameTypeRequiredDescription
collectionTypestring

Type of collection to retrieve

  • accessGroups
  • contentObjects
  • contentTypes
  • contracts
  • libraries

ContentLibraries

ContentLibraries() → Promise.<Array.<string>>

List content libraries - returns a list of content library IDs available to the current user

ContentLibrary

ContentLibrary({ libraryId }) → Promise.<Object>

Returns information about the content library

Parameters

NameTypeRequiredDescription
libraryIdstring

ContentLibraryOwner

ContentLibraryOwner({ libraryId }) → Promise.<string>

Returns the address of the owner of the specified content library

Returns: The account address of the owner

Parameters

NameTypeRequiredDescription
libraryIdstring

ContentObject

ContentObject({
  objectId, // optional
  versionHash, // optional
  writeToken // optional
}) → Promise.<Object>

Get info about a specific content object

Returns: Description of content object

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object -- if not specified, latest version is returned

writeTokenstring

Write token for an object draft -- if supplied, versionHash will be ignored

ContentObjectAccessComplete

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

NameTypeRequiredDescription
objectIdstring

ID of the object

scorenumber

Percentage score (0-100)

ContentObjectGraph

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version hash of the object -- if not specified, latest version is returned

autoUpdateboolean

If true, lists only links marked as auto-update links

(default: false)
selectstring | Array.<string>

Limit metadata fields return in link details

ContentObjectImageUrl

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version hash of the object -- if not specified, latest version is used

heightnumber

If specified, the image will be scaled to the specified maximum height

imagePathstring

Metadata path to the image link

(default: public/display_image)

ContentObjectLibraryId

ContentObjectLibraryId({
  objectId, // optional
  versionHash // optional
}) → Promise.<string>

Retrieve the library ID for the specified content object

Returns: Library ID of the object

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

ContentObjectMetadata

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

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version of the object -- if not specified, latest version is used

writeTokenstring

Write token of an object draft - if specified, will read metadata from the draft

metadataSubtreestring

Subtree of the object metadata to retrieve

queryParamsObject

Additional query params for the call

(default: {})
selectArray.<string>

Limit the returned metadata to the specified attributes

  • Note: Selection is relative to "metadataSubtree". For example, metadataSubtree="public" and select=["name", "description"] would select "public/name" and "public/description"
removeArray.<string>

Exclude the specified items from the retrieved metadata

authorizationTokenstring

Additional authorization token for this request

noAuthstring

If specified, the normal authorization flow will be skipped. Useful if you know the metadata you're retrieving is publicly accessible

(default: false)
resolveLinksboolean

If specified, links in the metadata will be resolved

(default: false)
resolveIncludeSourceboolean

If specified, resolved links will include the hash of the link at the root of the metadata

Example:

{
"resolved-link": {
".": {
"source": "hq__HPXNia6UtXyuUr6G3Lih8PyUhvYYHuyLTt3i7qSfYgYBB7sF1suR7ky7YRXsUARUrTB1Um1x5a"
},
"public": {
"name": "My Linked Object",
}
...
}
}
(default: false)
resolveIgnoreErrorsboolean

If specified, link errors within the requested metadata will not cause the entire response to result in an error

(default: false)
linkDepthLimitnumber

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)
produceLinkUrlsboolean

If specified, file and rep links will automatically be populated with a full URL

(default: false)

ContentObjectOwner

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

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

ContentObjects

ContentObjects({
  libraryId,
  filterOptions // optional
}) → Promise.<Array.<Object>>

List content objects in the specified library

Returns: List of objects in library

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

filterOptionsobject

Pagination, sorting and filtering options

filterOptions.startnumber

Start index for pagination

filterOptions.limitnumber

Max number of objects to return

filterOptions.sortArray.<string> | string

Sort by the specified key(s)

filterOptions.sortDescboolean

Sort in descending order

filterOptions.selectArray.<string> | string

Include only the specified metadata keys (all must start with /public)

filterOptions.filterArray.<object> | object

Filter objects by metadata

filterOptions.filter.keystring

Key to filter on (must start with /public)

filterOptions.filter.typestring

Type of filter to use for the specified key:

  • eq, neq, lt, lte, gt, gte, cnt (contains), ncnt (does not contain),
filterOptions.filter.filterstring

Filter for the specified key

ContentObjectTenantId

ContentObjectTenantId({
  objectId, // optional
  versionHash // optional
}) → Promise.<string>

Retrieve the tenant ID associated with the specified content object

Returns: Tenant ID of the object

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

ContentObjectVersions

ContentObjectVersions({
  libraryId,
  objectId
}) → Promise.<Object>

List the versions of a content object

Returns: Response containing versions of the object

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

ContentSpaceId

ContentSpaceId() → string

Get the ID of the current content space

Returns: contentSpaceId - The ID of the current content space

ContentType

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

NameTypeRequiredDescription
namestring

Name of the content type to find

typeIdstring

ID of the content type to find

versionHashstring

Version hash of the content type to find

publicOnlyboolean

If specified, will only retrieve public metadata (no access request needed)

(default: false)

ContentTypeOwner

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

NameTypeRequiredDescription
namestring

Name of the content type to find

typeIdstring

ID of the content type to find

versionHashstring

Version hash of the content type to find

ContentTypes

ContentTypes({}) → Promise.<Object>

List all content types accessible to this user.

Returns: Available content types

Decrypt

Decrypt({
  libraryId,
  objectId,
  writeToken,
  chunk
}) → Promise.<ArrayBuffer>

Decrypt the specified chunk for the specified object or draft

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

writeTokenstring

Write token of the content object draft

chunkArrayBuffer | Buffer

The data to decrypt

DefaultKMSAddress

DefaultKMSAddress({ tenantId }) // optional → Promise.<string>

Get the address of the default KMS of the content space or the provided tenant

Returns: Address of the KMS

Parameters

NameTypeRequiredDescription
tenantIdstring

An ID of a tenant contract - if not specified, the content space contract will be used

EmbedUrl

EmbedUrl({
  objectId,
  versionHash,
  duration,
  mediaType, // optional
  options
}) → Promise.<string>

Get an embed URL for the specified object

Returns: Will return an embed URL

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

durationnumber

Time until the token expires, in milliseconds (1 day = 24 * 60 * 60 * 1000 = 86400000)

mediaTypestring

The type of the media. Available options:

  • video
  • live_video
  • audio
  • image
  • gallery
  • ebook
  • html
(default: video)
optionsObject

Additional video/player options

  • autoplay - If enabled, video will autoplay. Note that videos block autoplay of videos with audio by default
  • capLevelToPlayerSize - Caps video quality to player size
  • clipEnd - End time for the video
  • clipStart - Start time for the video
  • controls - Sets the player control visibility. Values: browserDefault | autoHide | show | hide | hideWithVolume. Defaults to autoHide
  • description - Sets the page description
  • directLink - If enabled, sets direct link
  • linkPath - Video link path
  • loop - If enabled, video will loop
  • muted - Mutes the player
  • offerings - Offerings to play, as an array
  • posterUrl - URL of the player poster image
  • protocols - Video protocols, as an array
  • showShare - Show social media share buttons
  • showTitle - Shows the video title, which is set from the title option (if set) or the metadata
  • title - Sets the page title
  • viewRecordKey - Contains record key
  • useTicketCodes - Use tickets authorization
  • tenantId - Tenant ID, required for tickets authorization
  • ntpId - NTP ID, required for tickets authorization
  • ticketCode - Ticket code, optional with tickets authorization
  • ticketSubject - Ticket subject, optional with tickets authorization
  • verifyContent - Verify content
  • additionalParameters - Additional search params that will be appended to the URL

Encrypt

Encrypt({
  libraryId,
  objectId,
  writeToken,
  chunk
}) → Promise.<ArrayBuffer>

Encrypt the specified chunk for the specified object or draft

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

writeTokenstring

Write token of the content object draft

chunkArrayBuffer | Buffer

The data to encrypt

EncryptionConk

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 - The encryption conk for the object

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version hash of the object

writeTokenstring

Write token of the content object draft

downloadboolean

If specified, will return keys appropriate for download (if the current user is not the owner of the object, download will be performed via proxy-reencryption)

(default: false)

FabricUrl

FabricUrl({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  writeToken, // optional
  partHash, // optional
  rep, // optional
  publicRep, // optional
  call, // optional
  queryParams, // optional
  service, // optional
  channelAuth, // optional
  noAuth, // optional
  noCache, // optional
  makeAccessRequest // optional
}) → Promise.<string>

Generate a URL to the specified item in the content fabric with appropriate authorization token.

Returns: URL to the specified endpoint with authorization token

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of an library

objectIdstring

ID of an object

versionHashstring

Hash of an object version

writeTokenstring

A write token for a draft of the object (requires libraryId)

partHashstring

Hash of a part - Requires object ID

repstring

Rep parameter of the url

publicRepstring

Public rep parameter of the url

callstring

Bitcode method to call

queryParamsObject

Query params to add to the URL

servicestring

The service to use. By default, will use a fabric node. Options: "fabric", "search", "auth"

(default: fabric)
channelAuthboolean

If specified, state channel authorization will be used instead of access request authorization

(default: false)
noAuthboolean

If specified, authorization will not be performed and the URL will not have an authorization token. This is useful for accessing public assets.

(default: false)
noCacheboolean

If specified, a new access request will be made for the authorization regardless of whether such a request exists in the client cache. This request will not be cached. This option has no effect if noAuth is true.

(default: false)
makeAccessRequestboolean

If using auth, will make a full access request

(default: false)

FileUrl

FileUrl({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  writeToken, // optional
  filePath,
  queryParams, // optional
  noCache // optional
}) → Promise.<string>

Generate a URL to the specified content object file with appropriate authorization token.

Returns: URL to the specified file with authorization token

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of an library

objectIdstring

ID of an object

versionHashstring

Hash of an object version

writeTokenstring

A write token for a draft of the object (requires libraryId)

filePathstring

Path to the content object file

queryParamsObject

Query params to add to the URL

noCacheboolean

If specified, a new access request will be made for the authorization regardless of whether such a request exists in the client cache. This request will not be cached.

(default: false)

FinalizeStateChannelAccess

FinalizeStateChannelAccess({
  objectId, // optional
  versionHash, // optional
  percentComplete
})

Finalize state channel access

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

percentCompletenumber

Completion percentage of the content

GenerateStateChannelToken

GenerateStateChannelToken({
  objectId, // optional
  versionHash, // optional
  context, // optional
  noCache // optional
}) → Promise.<string>

Generate a state channel token.

Returns: The state channel token

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

contextObject

Additional audience data to include in the authorization request

  • Note: Context must be a map of string->string
noCacheboolean

If specified, a new state channel token will be generated regardless whether or not one has been previously cached

(default: false)

GlobalUrl

GlobalUrl({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  writeToken, // optional
  path, // optional
  authorizationToken, // optional
  noAuth, // optional
  resolve, // optional
  queryParams // optional
}) → Promise.<string>

Create a 'global' URL with the specified parameters

A global URL is a URL that will resolve to a Fabric node close to the resolver. This is useful in cases where URLS are being passed to clients that may be in a different geographical location from where the URL was created.

Returns: The generated global URL

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Version hash of the object

writeTokenstring

Write token of an object draft

pathstring

Path of the URL

authorizationTokenstring

Authorization token for the URL. If not specified and noAuth is false, the client will generate the token automatically

noAuthboolean

Set to true if the URL is for publicly accessible content

(default: false)
resolveboolean

Whether links should resolve (if this URL is for metadata)

(default: false)
queryParamsObject

Additional URL query params

(default: {})

LatestVersionHash

LatestVersionHash({
  objectId, // optional
  versionHash // optional
}) → Promise.<string>

Retrieve the version hash of the latest version of the specified object via fabric API.

Returns: The latest version hash of the object

Parameters

NameTypeRequiredDescription
objectIdstring

ID of the object

versionHashstring

Version hash of the object

LibraryContentTypes

LibraryContentTypes({ libraryId }) → Promise.<Object>

Retrieve the allowed content types for the specified library.

Note: If no content types have been set on the library, all types are allowed, but an empty hash will be returned.

Returns: List of accepted content types - return format is equivalent to ContentTypes method

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

LinkData

LinkData({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  writeToken, // optional
  linkPath,
  queryParams, // optional
  format, // optional
  channelAuth // optional
})

Retrieve the data at the specified link in the specified format

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of an library

objectIdstring

ID of an object

versionHashstring

Hash of an object version

writeTokenstring

The write token for the object

linkPathstring

Path to the content object link

queryParamsObject

Query params to add to the URL

formatstring

Format of the response

(default: json)
channelAuthboolean

If specified, state channel authorization will be performed instead of access request authorization

(default: false)

LinkTarget

LinkTarget({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  writeToken, // optional
  linkPath,
  authorizationToken // optional
}) → Promise.<string>

Retrieve the version hash of the target of the specified link. If the target is the same as the specified object and versionHash is not specified, will return the latest version hash.

Returns: Version hash of the link's target

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of an library

objectIdstring

ID of an object

versionHashstring

Hash of an object version

writeTokenstring

The write token for the object

linkPathstring

Path to the content object link

authorizationTokenstring

Additional authorization token for this request

LinkUrl

LinkUrl({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  writeToken, // optional
  linkPath,
  mimeType, // optional
  queryParams, // optional
  authorizationToken, // optional
  channelAuth, // optional
  noAuth // optional
}) → Promise.<string>

Generate a URL to the specified file link with appropriate authentication

Returns: URL to the specified file with authorization token

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of an library

objectIdstring

ID of an object

versionHashstring

Hash of an object version

writeTokenstring

The write token for the object

linkPathstring

Path to the content object link

mimeTypestring

Mime type to use when rendering the file

queryParamsObject

Query params to add to the URL

authorizationTokenstring

Additional authorization token

channelAuthboolean

If specified, state channel authorization will be performed instead of access request authorization

(default: false)
noAuthboolean

If specified, no authorization (other than the authorizationToken parameter and queryParams.authorization) will be added

Permission

Permission(
  objectId,
  clearCache // optional
) → string

Get the current permission level for the specified object. See client.permissionLevels for all available permissions.

Note: This method is only intended for normal content objects, not types, libraries, etc.

Returns: Key for the permission of the object - Use this to retrieve more details from client.permissionLevels

Parameters

NameTypeRequiredDescription
objectIdstring

The ID of the object

clearCacheboolean

Clear any Visibility info cached by client for this object (forces new Ethereum calls)

PlayoutOptions

PlayoutOptions({
  offeringURI, // optional
  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 for the specified content that satisfy the given protocol and DRM requirements

The root level playoutOptions[protocol].playoutUrl and playoutOptions[protocol].drms will contain playout information that satisfies the specified DRM requirements (if possible), while playoutOptions[protocol].playoutMethods will contain all available playout options for this content.

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

NameTypeRequiredDescription
offeringURIstring

A URI pointing directly to the playout options endpoint

objectIdstring

ID of the content

versionHashstring

Version hash of the content

writeTokenstring

Write token for the content

linkPathstring

If playing from a link, the path to the link

signedLinkboolean

Specify if linkPath is referring to a signed link

protocolsArray.<string>

Acceptable playout protocols ("dash", "hls")

(default: ["dash","hls"])
drmsArray.<string>

Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine")

handlerstring

The handler to use for playout (not used with links)

(default: playout)
offeringstring

The offering to play

(default: default)
playoutTypestring

The type of playout

contextObject

Additional audience data to include in the authorization request.

  • Note: Context must be a map of string->string
authorizationTokenObject

Additional authorization token for authorizing this request

optionsObject

Additional query parameters to pass when requesting available playout options, such as clipping parameters.

Proofs

Proofs({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  partHash
}) → Promise.<Object>

Get the proofs associated with a given part

Returns: Response containing proof information

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Hash of the object version - If not specified, latest version will be used

partHashstring

Hash of the part

PublicRep

PublicRep({
  libraryId, // optional
  objectId, // optional
  versionHash, // optional
  rep,
  queryParams // optional
}) → Promise.<string>

Generate a URL to the specified /public endpoint of a content object. URL includes authorization token.

Alias for the FabricUrl method with the "rep" parameter

Returns: URL to the specified rep endpoint with authorization token

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

versionHashstring

Hash of the object version - if not specified, latest version will be used

repstring

Representation to use

queryParamsObject

Query params to add to the URL

QParts

QParts({
  libraryId,
  objectId,
  partHash,
  format
}) → Promise.<Format>

Get part info in CBOR format

Returns: Response containing the CBOR response in the specified format

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library - required for authentication

objectIdstring

ID of the object - required for authentication

partHashstring

Hash of the part

formatstring

Format to retrieve the response - defaults to Blob

Rep

Rep({
  libraryId, // optional
  objectId, // optional
  writeToken, // optional
  versionHash, // optional
  rep,
  queryParams, // optional
  service, // optional
  channelAuth, // optional
  noAuth, // optional
  noCache, // optional
  makeAccessRequest // optional
}) → Promise.<string>

Generate a URL to the specified /rep endpoint of a content object. URL includes authorization token.

Alias for the FabricUrl method with the "rep" parameter

Returns: URL to the specified rep endpoint with authorization token

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

writeTokenstring

A write token for a draft of the object (requires libraryId)

versionHashstring

Hash of the object version - if not specified, latest version will be used

repstring

Representation to use

queryParamsObject

Query params to add to the URL

servicestring

The service to use. By default, will use a fabric node. Options: "fabric", "search", "auth"

(default: fabric)
channelAuthboolean

If specified, state channel authorization will be performed instead of access request authorization

(default: false)
noAuthboolean

If specified, authorization will not be performed and the URL will not have an authorization token. This is useful for accessing public assets.

(default: false)
noCacheboolean

If specified, a new access request will be made for the authorization regardless of whether such a request exists in the client cache. This request will not be cached. This option has no effect if noAuth is true.

(default: false)
makeAccessRequestboolean

If using auth, will make a full access request

(default: false)

SetAuthContext

SetAuthContext({ context }) // optional

Specify additional context to include in all state channel requests made by the client (e.g. for playout)

Parameters

NameTypeRequiredDescription
contextObject

Additional context to include in state channel requests

  • Note: Context must be a map of string->string