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).
PUT /v1/relationship¶Create or update an Asset Relationship.
| Query Parameters: | |
|---|---|
|
|
| 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"
}
]
DELETE /v1/relationship¶Delete an Asset Relationship.
| Query Parameters: | |
|---|---|
|
|
| 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'
GET /v1/relationship¶Find Asset Relationships based on one or more attributes.
| Query Parameters: | |
|---|---|
|
|
| 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"
}
]