Skip to content
On this page

Admin Resource API

EndpointMethodDescription
/resource/{resourceId}webRequestRead resource
/resource/thumbnail/{size}/{resourceId}webRequestRead resource thumbnail
/resource/upload/linkwebRequestDirect upload to Google bucket (get upload link)
/resource/upload/link/completewebRequestDirect upload to Google bucket (complete upload link)
/resource/upload/remote/urlwebRequestRemote url upload
/resource/upload/remote/imagewebRequestRemote image upload
/asset/thumbnail/{assetId}webRequestRead asset thumbnail
/jsonRpc/resource.searchYoutubejsonRpcSearch youtube
/jsonRpc/resource.searchPixabayjsonRpcSearch pixabay
/jsonRpc/resource.searchImdbjsonRpcSearch imdb
/jsonRpc/resource.createResourcejsonRpcCreate resource
/jsonRpc/resource.createYoutubeResourcejsonRpcCreate youtube resource
/jsonRpc/resource.createImdbResourcejsonRpcCreate imdb resource
/jsonRpc/resource.updateResourceAttributesjsonRpcUpdate resource attributes

Read resource

HTTP Method: GET

Path: /resource/

Description: Endpoint redirects to direct resource location.

Request:

{ empty }

Response:

Resource data

Read resource thumbnail

HTTP Method: GET

Path: /resource/thumbnail/{size}/

Description: Endpoint redirects to direct resource location.

Request:

{ empty }

Response:

Resource data

HTTP Method: POST

Path: /resource/upload/link

Description: Direct upload gives possibility to upload files directly from a client to a storage bucket. It consist of next steps:

  1. Client asks the server for upload link. The server initializes an upload session and returns a link which could be used for upload.

  2. Client uploads a file to Google bucket.

  3. Client sends upload complete acknowledgment to the server.

Headers:

X-Resource-Id: resourceId

Request:

{ empty }

Response:

Google bucket upload link

HTTP Method: POST

Path: /resource/upload/link/complete

Description: See direct upload to Google bucket.

Headers:

X-Resource-Id: resourceId

Request:

{ empty }

Response:

{ empty }

Remote url upload

HTTP Method: POST

Path: /resource/upload/remote/url

Request:

{
    "url": string
    "urlType": string  // Hls/Dash
    "parent": string  // mark that resource belongs to directory
    "roomId": string  // mark that resource belongs to room
    "contributeToRoom": string  // mark that resource belongs to room sorting table
    "addToSortingTable": bool  // mark that resource belongs to user sorting table
    "belonging": string  // use custom belonging (like 'userAIGeneration:{userId}')
}

Response:

{
    "id": string
    "created": timestamp
    "updated": timestamp
    "title": string
    "description": string
    "location": string
    "date": string
    "category": string
    "linkId": string  // id of resource link is pointing to
    "linkType": string  // global/local
    "encryptionVersion": string  // encryption version, like 'verus.v1'
    "encryptionEpoch": int  // epoch defines key bundle that was used for encryption
    "encryptionEpk": string  // ephemeral public key that should be used to decrypt cypher data
    "belonging": string  // determines resource location in the system in a way 'belongingType:belongingPath(networkId)'
    "status": string  // pending/processing/ready/failed
    "metadata": {
        "fileName": string
        "fileSize": int
        "fileDate": timestamp
        "behaviourType": string
        "contentType": string
        "convertedFrom": string
        "link": string
        "origin": { resource origin structure }
        "geolocation": { geolocation structure }
        "dimensions": { dimensions structure }
    }
    "thumbnail": string
    "fromTemplate": bool
    "totalReactions": int  // amount of users who reacted to the resource
    "data": {
        "audio": { resource data audio structure }
        "video": { resource data video structure }
        "amazon": { resource data amazon structure }
        "imdb": { resource data imdb structure }
        "youtube": { resource data youtube structure }
        "pinterest": { resource data pinterest structure }
        "pixabay": { resource data pixabay structure }
        "facebook": { resource data facebook structure }
        "remoteUrl": { resource data remote url structure }
        "liveStream": { live stream data structure }
        "aiGeneration": { ai generation data structure }
        "thumbnailUrl": string
        "downloadUrl": string
        "directory": { resource data directory structure }
        "channel": { channel data structure }
        "googleDrive": { google drive structure }
    }
    "customParams": map[string]{ custom structure }  // client defined parameters
    "actions": [{ programmatic action with children structure }]  // custom programmatic actions from users
}

Remote image upload

HTTP Method: POST

Path: /resource/upload/remote/image

Request:

{
    "url": string
    "title": string
    "source": string
    "sourceId": string
    "sourceLink": string
    "parent": string  // mark that resource belongs to directory
    "roomId": string  // mark that resource belongs to room
    "contributeToRoom": string  // mark that resource belongs to room sorting table
    "addToSortingTable": bool  // mark that resource belongs to user sorting table
    "belonging": string  // use custom belonging (like 'userAIGeneration:{userId}')
}

Response:

{
    "id": string
    "created": timestamp
    "updated": timestamp
    "title": string
    "description": string
    "location": string
    "date": string
    "category": string
    "linkId": string  // id of resource link is pointing to
    "linkType": string  // global/local
    "encryptionVersion": string  // encryption version, like 'verus.v1'
    "encryptionEpoch": int  // epoch defines key bundle that was used for encryption
    "encryptionEpk": string  // ephemeral public key that should be used to decrypt cypher data
    "belonging": string  // determines resource location in the system in a way 'belongingType:belongingPath(networkId)'
    "status": string  // pending/processing/ready/failed
    "metadata": {
        "fileName": string
        "fileSize": int
        "fileDate": timestamp
        "behaviourType": string
        "contentType": string
        "convertedFrom": string
        "link": string
        "origin": { resource origin structure }
        "geolocation": { geolocation structure }
        "dimensions": { dimensions structure }
    }
    "thumbnail": string
    "fromTemplate": bool
    "totalReactions": int  // amount of users who reacted to the resource
    "data": {
        "audio": { resource data audio structure }
        "video": { resource data video structure }
        "amazon": { resource data amazon structure }
        "imdb": { resource data imdb structure }
        "youtube": { resource data youtube structure }
        "pinterest": { resource data pinterest structure }
        "pixabay": { resource data pixabay structure }
        "facebook": { resource data facebook structure }
        "remoteUrl": { resource data remote url structure }
        "liveStream": { live stream data structure }
        "aiGeneration": { ai generation data structure }
        "thumbnailUrl": string
        "downloadUrl": string
        "directory": { resource data directory structure }
        "channel": { channel data structure }
        "googleDrive": { google drive structure }
    }
    "customParams": map[string]{ custom structure }  // client defined parameters
    "actions": [{ programmatic action with children structure }]  // custom programmatic actions from users
}

Read asset thumbnail

HTTP Method: GET

Path: /asset/thumbnail/

Description: Endpoint redirects to direct asset thumbnail location.

Request:

{ empty }

Response:

Resource data

Search youtube

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.searchYoutube

Request:

{
    "query": string
}

Response:

{
    "data": {
        "hits": [{
            "etag": string
            "id": {
                "channelId": string
                "kind": string
                "playlistId": string
                "videoId": string
            }
            "kind": string
            "snippet": {
                "channelId": string
                "channelTitle": string
                "description": string
                "liveBroadcastContent": string
                "publishedAt": string
                "thumbnails": {
                    "default": {
                        "height": int
                        "url": string
                        "width": int
                    }
                    "high": {
                        "height": int
                        "url": string
                        "width": int
                    }
                    "maxres": {
                        "height": int
                        "url": string
                        "width": int
                    }
                    "medium": {
                        "height": int
                        "url": string
                        "width": int
                    }
                    "standard": {
                        "height": int
                        "url": string
                        "width": int
                    }
                }
                "title": string
            }
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Search pixabay

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.searchPixabay

Request:

{
    "query": string
}

Response:

{
    "data": {
        "hits": [{
            "id": int
            "pageURL": string
            "type": string
            "tags": string
            "previewURL": string
            "previewWidth": int
            "previewHeight": int
            "webformatURL": string
            "webformatWidth": int
            "webformatHeight": int
            "largeImageURL": string
            "fullHDURL": string
            "imageURL": string
            "imageWidth": int
            "imageHeight": int
            "imageSize": int
            "views": int
            "downloads": int
            "favorites": int
            "likes": int
            "comments": int
            "user_id": int
            "user": string
            "userImageURL": string
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Search imdb

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.searchImdb

Request:

{
    "query": string
}

Response:

{
    "data": {
        "hits": [{
            "Title": string
            "Year": string
            "imdbID": string
            "Type": string
            "Poster": string
            "Plot": string
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Create resource

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.createResource

Request:

{
    "resource": { resource structure }
    "parent": string  // mark that resource belongs to directory
    "roomId": string  // mark that resource belongs to room
    "contributeToRoom": string  // mark that resource belongs to room sorting table
    "addToSortingTable": bool  // mark that resource belongs to user sorting table
    "belonging": string  // use custom belonging (like 'userAIGeneration:{userId}')
}

Response:

{
    "data": {
        "resource": { resource structure }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Create youtube resource

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.createYoutubeResource

Request:

{
    "id": string
    "parent": string  // mark that resource belongs to directory
    "roomId": string  // mark that resource belongs to room
    "contributeToRoom": string  // mark that resource belongs to room sorting table
    "addToSortingTable": bool  // mark that resource belongs to user sorting table
    "belonging": string  // use custom belonging (like 'userAIGeneration:{userId}')
}

Response:

{
    "data": {
        "resource": { resource structure }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Create imdb resource

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.createImdbResource

Request:

{
    "id": string
    "parent": string  // mark that resource belongs to directory
    "roomId": string  // mark that resource belongs to room
    "contributeToRoom": string  // mark that resource belongs to room sorting table
    "addToSortingTable": bool  // mark that resource belongs to user sorting table
    "belonging": string  // use custom belonging (like 'userAIGeneration:{userId}')
}

Response:

{
    "data": {
        "resource": { resource structure }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Update resource attributes

Method: jsonRpc

HTTP Method: POST

Path: /jsonRpc/resource.updateResourceAttributes

Permissions:

prop.manage /networkId/roomId/propId

Request:

{
    "resourceId": string
    "attributes": {
        "title": string
        "description": string
        "location": string
        "date": string
        "category": string
    }
}

Response:

{ empty }

Models


Resource Origin

{
    "type": string
    "device": string
    "deviceName": string
    "path": string
}

Geolocation

{
    "latitude": float
    "longitude": float
}

Dimensions

{
    "width": int
    "height": int
    "orientation": int
}

Resource Data Audio

{
    "title": string
    "artist": string
    "album": string
    "genre": string
    "duration": int
    "durationFloat": float
}

Resource Data Video

{
    "duration": int
    "durationFloat": float
    "hasAlphaChannel": bool  // true, if video generated from gif with transparent pixels
    "alphaChannel": string  // alpha channel video resource (if generated from gif)
}

Resource Data Amazon

{
    "asin": string
    "summary": string
    "author": [ string ]
    "manufacturer": string
    "title": string
    "publicationDate": string
    "url": string
}

Resource Data Imdb

{
    "Actors": string
    "Genre": string
    "Ratings": [{
        "Source": string
        "Value": string
    }]
    "Released": string
    "Runtime": string
    "Website": string
    "Year": string
    "Trailers": [ string ]
    "imdbID": string
}

Resource Data Youtube

{
    "videoId": string
    "formatId": string
}

Resource Data Pinterest

{
    "pin": string
    "url": string
}

Resource Data Pixabay

{
    "id": string
    "pageUrl": string
}

Resource Data Facebook

{
    "id": string
}

Resource Data Remote Url

{
    "url": string
    "urlType": string
    "favicon": string
    "title": string
}

Live Stream Data

{
    "streamId": string
    "assetId": string
    "playbackUrl": string
    "masterUrl": string
}

AI Generation Data

{
    "generationModel": string  // the model used for image generation [dall-e-3]
    "prompt": string  // a text description of the desired image
    "revisedPrompt": string  // the prompt that was used to generate the image, if there was any revision to the prompt
    "url": string  // the URL of the generated image
}

Resource Data Directory

{
    "innerContentType": string
    "innerContentCount": int
}

Channel Data

{
    "communityId": string
    "channelId": string
    "subChannelId": string
    "messageId": string
}

Google Drive

{
    "fileId": string
    "name": string
    "mimeType": string
}

Programmatic Action with children

{
    "localId": string  // local action id, operated by client side only
    "eventName": string
    "actionName": string
    "actionData": {
        "usedPropId": string
        "usedRoomId": string
        "usedNetworkId": string
        "usedStorylineId": string
        "usedQuestionId": int
        "usedQuestionnaireId": int
        "usedSegmentId": string
        "usedPlacementAreaId": string
        "usedRoomPoint": string
        "animationData": map[string]{ custom structure }
    }
    "childActions": [{ programmatic action structure }]
}

Programmatic Action

{
    "localId": string  // local action id, operated by client side only
    "eventName": string
    "actionName": string
    "actionData": {
        "usedPropId": string
        "usedRoomId": string
        "usedNetworkId": string
        "usedStorylineId": string
        "usedQuestionId": int
        "usedQuestionnaireId": int
        "usedSegmentId": string
        "usedPlacementAreaId": string
        "usedRoomPoint": string
        "animationData": map[string]{ custom structure }
    }
}

Resource

{
    "id": string
    "created": timestamp
    "updated": timestamp
    "title": string
    "description": string
    "location": string
    "date": string
    "category": string
    "linkId": string  // id of resource link is pointing to
    "linkType": string  // global/local
    "encryptionVersion": string  // encryption version, like 'verus.v1'
    "encryptionEpoch": int  // epoch defines key bundle that was used for encryption
    "encryptionEpk": string  // ephemeral public key that should be used to decrypt cypher data
    "belonging": string  // determines resource location in the system in a way 'belongingType:belongingPath(networkId)'
    "status": string  // pending/processing/ready/failed
    "metadata": {
        "fileName": string
        "fileSize": int
        "fileDate": timestamp
        "behaviourType": string
        "contentType": string
        "convertedFrom": string
        "link": string
        "origin": { resource origin structure }
        "geolocation": { geolocation structure }
        "dimensions": { dimensions structure }
    }
    "thumbnail": string
    "fromTemplate": bool
    "totalReactions": int  // amount of users who reacted to the resource
    "data": {
        "audio": { resource data audio structure }
        "video": { resource data video structure }
        "amazon": { resource data amazon structure }
        "imdb": { resource data imdb structure }
        "youtube": { resource data youtube structure }
        "pinterest": { resource data pinterest structure }
        "pixabay": { resource data pixabay structure }
        "facebook": { resource data facebook structure }
        "remoteUrl": { resource data remote url structure }
        "liveStream": { live stream data structure }
        "aiGeneration": { ai generation data structure }
        "thumbnailUrl": string
        "downloadUrl": string
        "directory": { resource data directory structure }
        "channel": { channel data structure }
        "googleDrive": { google drive structure }
    }
    "customParams": map[string]{ custom structure }  // client defined parameters
    "actions": [{ programmatic action with children structure }]  // custom programmatic actions from users
}