Asset Relationship API

An Asset Relationship is a link between an asset and any other data entity which is identifiable by a unique ID. Each relationship contains an Asset ID and a Related ID, as well as a Relationship Type. These are used to model relationships with both external sources (such as Scenes and Objects), and between assets (such as having one Asset be the thumbnail of another).

Asset Relationship Save

PUT /v1/relationship

Create or update an Asset Relationship.

Query Parameters:
 
  • asset (string) – Optional. If this and ‘type’ are specified, then this will overwrite matching Relationships.
  • related (string) – Optional. If this and ‘type’ are specified, then this will overwrite matching Relationships.
  • type (string) – Optional. Must appear with ‘related’ or ‘asset’. The type of Relationship to override.
Request Headers:
 
Status Codes:

http

PUT /v1/relationship HTTP/1.1
Host: localhost:8080
Content-Type: application/json

{
  "assetId": "asset123",
  "assetSubId": "meshName",
  "relationshipType": "scene",
  "relationshipSubtype": "mesh",
  "relatedId": "scene123"
}

curl

curl -i -X PUT http://localhost:8080/v1/relationship -H 'Content-Type: application/json' --data-raw '{"assetId": "asset123", "assetSubId": "meshName", "relatedId": "scene123", "relationshipSubtype": "mesh", "relationshipType": "scene"}'

response

HTTP/1.1 200 OK
Location: http://localhost:8080/v1/relationship

[
    {
        "id": "5bbec73700bd755e5e2e9630",
        "assetId": "5bbd6ea100bd75575fb32ca8",
        "relationshipType": "scene",
        "relatedId": "123"
    }
]

Asset Relationship Deletion

DELETE /v1/relationship

Delete an Asset Relationship.

Query Parameters:
 
  • asset (string) – Required. The Asset ID of the Relationship to delete.
  • related (string) – Required. The Related ID of the Relationship to delete.
  • type (string) – Required. The type of Relationship to delete.
Status Codes:

http

DELETE /v1/relationship?type=scene&related=123&asset=456 HTTP/1.1
Host: localhost:8080

curl

curl -i -X DELETE 'http://localhost:8080/v1/relationship?type=scene&related=123&asset=456'

Asset Relationship Query

GET /v1/relationship

Find Asset Relationships based on one or more attributes.

Query Parameters:
 
  • asset (string) – Required. The Asset ID of the Relationship to find.
  • related (string) – Required. The Related ID of the Relationship to find.
  • type (string) – Required. The type of Relationship to find.
Status Codes:

http

GET /v1/relationship?type=scene&related=123 HTTP/1.1
Host: localhost:8080

curl

curl -i 'http://localhost:8080/v1/relationship?type=scene&related=123'

response

HTTP/1.1 200 OK
Location: http://localhost:8080/v1/relationship?type=scene&related=123

[
    {
        "id": "5bbd6ea100bd75575fb32caa",
        "assetId": "5bbd6ea100bd75575fb32ca8",
        "assetSubId": "meshName",
        "relationshipType": "object",
        "relationshipSubtype": "mesh",
        "relatedId": "5bbd6da600bd75575fb32ca5"
    }
]