Skip to content
On this page

Partner: ResourceInfo API ​

EndpointMethodDescription
/api/v0/partnerRpc/resourceInfo.getResourceByIdjsonRpcGet resource by id
/api/v0/partnerRpc/resourceInfo.getResourceUrljsonRpcGet resource url
/api/v0/partnerRpc/resourceInfo.updateResourceEnrichmentjsonRpcUpdate resource enrichment
/api/v0/partnerRpc/resourceInfo.setBelongingIndexStatejsonRpcSet belonging index state
/api/v0/partnerRpc/resourceInfo.fetchPendingJobsjsonRpcFetch pending jobs
/api/v0/partnerRpc/resourceInfo.completeJobjsonRpcComplete job
/api/v0/partnerRpc/resourceInfo.checkUserCanViewBelongingjsonRpcCheck user can view belonging
/api/v0/partnerRpc/resourceInfo.checkUserCanViewResourcejsonRpcCheck user can view resource
/api/v0/partnerRpc/resourceInfo.searchBelongingjsonRpcSearch belonging
/api/v0/partnerRpc/resourceInfo.listParentDirectoriesjsonRpcList parent directories

Get resource by id ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.getResourceById

Description: API returns resource metadata by its id.

Request:

{
    "resourceId": string
}

Response:

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

Get resource url ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.getResourceUrl

Description: API returns direct URL to resource file data.

Request:

{
    "resourceId": string
}

Response:

{
    "data": {
        "url": string
        "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
    }
    "error": { "status": bool, "code": int, "message": string }
}

Update resource enrichment ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.updateResourceEnrichment

Description: API updates resource after AI enrichment.

Request:

{
    "resourceId": string
    "enrichment": { enrichment data structure }
    "title": string
    "description": string
}

Response:

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

Set belonging index state ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.setBelongingIndexState

Description: API sets indexation state of a belonging (filled by RAG).

Request:

{
    "belonging": string
    "state": map[string]{ custom structure }
}

Response:

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

Fetch pending jobs ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.fetchPendingJobs

Description: API returns pending resource enrichment jobs to process. Each returned job is leased - call resourceInfo.completeJob to report the outcome, or it becomes fetchable again once the lease expires.

Request:

{
    "limit": int  // max number of jobs to return (1-100)
}

Response:

{
    "data": {
        "jobs": [{
            "jobId": string
            "payload": {
                "resourceId": string
                "networkId": string
            }
            "attemptCount": int  // how many times this job has been leased so far, including this time
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Complete job ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.completeJob

Description: API reports the outcome of a resource enrichment job: success completes it, failure either requeues it for retry or dead-letters it once attempts are exhausted. Idempotent - completing an already-terminal job again is a no-op, not an error.

Request:

{
    "jobId": string
    "success": bool
    "error": string  // error message when success is false
}

Response:

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

Check user can view belonging ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.checkUserCanViewBelonging

Description: API return no error if user has permission to view belonging resources.

Request:

{
    "userId": string
    "belonging": {
        "networkId": string
        "belongingType": string
        "belongingId": string
        "belongingPath": string
    }
    "grantToken": string  // optional; one-time token that grants permission for this action
}

Response:

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

Check user can view resource ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.checkUserCanViewResource

Description: API return no error if user has permission to view resource.

Request:

{
    "userId": string
    "resourceId": string
}

Response:

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

Search belonging ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.searchBelonging

Description: API returns resources by its belonging.

Request:

{
    "belonging": {
        "networkId": string
        "belongingType": string
        "belongingId": string
        "belongingPath": string
    }
    "query": string
    "filterBy": string  // filter content (directory/noDirectory)
    "cursor": string
    "limit": int
}

Response:

{
    "data": {
        "resources": [{ resource structure }]
        "nextCursor": string
        "hasMore": bool
        "permissions": {
            "get": bool  // permission to fetch single item from belonging
            "list": bool  // permission to list items within belonging
            "create": bool  // permission to add item to belonging
            "update": bool  // permission to update item within belonging
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

List parent directories ​

Method: jsonRpc

HTTP Method: POST

Path: /api/v0/partnerRpc/resourceInfo.listParentDirectories

Description: API returns parent directories for resource, from top to bottom.

Request:

{
    "resourceId": string
}

Response:

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

Models ​


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
    "userId": string  // user id of resource author
    "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 }
        "vimeo": { resource data vimeo 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 }
        "googleDrive": { google drive structure }
        "channel": { channel data structure }
        "enrichment": { enrichment data structure }
    }
    "customParams": map[string]{ custom structure }  // client defined parameters
    "actions": [{ programmatic action with children structure }]  // custom programmatic actions from users
}

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 Vimeo ​

{
    "videoUrl": 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
    "createdAt": int
}

AI Generation Data ​

{
    "generationModel": string  // the model used for image generation [gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini]; defaults to gpt-image-2
    "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
}

Google Drive ​

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

Channel Data ​

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

Enrichment Data ​

{
    "categories": [ string ]
    "enrichedAt": timestamp
    "enrichmentStatus": string
    "language": string
    "qualityScore": int
    "tags": [ 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 }
    }
}