ProjectAssets




Changed in version 1

Previously in version 0 this resource URL was project but was changed to projectassets in order to conform to internal model naming.

  Get All Project Assets GET /projectassets/

Description

Request a list of all available projects.

Properties

Title

Get all project assets

URL

/projectassets/

Method

GET


Header

Name

Value

Required

Description

Authorization

Token xxxxx

yes

Authorization token required to communicate with the API.


URL Params

NameTypeRequiredDescription

limit

integer

no

Limit the number of objects to return.

offsetintegernoDo not return the first x objects, where x is the amount specified by offset.
bundle_rootstringnoFilter parameter to only list project assets with the given bundle_root. Value MUST end with slash and SHOULD be URL encoded.

Success Response

200 - OK

[
  {
    "id": 1,
    "audio_assets": [{AUDIOASSET_OBJECT},...],
    "image_assets": [{IMAGEASSET_OBJECT},...],
    "video_assets": [{VIDEOASSET_OBJECT},...],
    "name": "Project Asset Name",
    "description": "Project asset description.",
    "date_crt": null,
    "date_add": "2017-01-13T17:30:00.897951Z",
    "date_mod": "2017-01-13T17:30:00.922517Z",
    "date_del": null,
    "status_asset": 6,
    "status_asset_description": "",
    "status_editing": 0,
    "status_approval": 1,
    "path_file": "/path/to/project/bundle/root/project_file.fcp",
    "bundle_root": "/path/to/project/bundle/root/",
    "type": "",
    "is_archive": false,
    "is_production": true,
    "files": {},
    "name_editor": "",
    "name_studio": "",
    "locked_by": null,
    "production": 1,
    "device": 4
  },
  ...
]

Sample Call

curl -X GET http://medialoopster-url/api/projectassets/

  Get Single Project Asset GET /projectassets/{id}/


Description

Request a specific project asset

Properties

Title

Get single project asset

URL

/projectassets/{id}/

Method

GET


Header

Name

Value

Required

Description

Authorization

Token xxxxx

yes

Authorization token required to communicate with the API.


Success Response

200 - OK

{
  "id": 1,
  "name": "Project Asset Name",
  "bundle_root": "/path/to/project/bundle/root/",
  "production": 1,
  "audio_assets": [{AUDIOASSET_OBJECT},...],
  "image_assets": [{IMAGEASSET_OBJECT},...],
  "video_assets": [{VIDEOASSET_OBJECT},...],
  "files": {...},
  ...
}

Error Response

404 - Not Found

{
  "errors": [
    {
      "status": "404",
      "code": "not_found",
      "detail": "ProjectAsset object with pk=u'{id}' does not exist.",
      "title": "Not Found"
    }
  ]
}

Sample Call

curl -X GET http://medialoopster-url/api/projectassets/1/

  Create Project AssetPOST /projectassets/

Description

Create a project asset.

The request body can either be form-data or raw data. The latter requires "application/json" as a Content-Type header

Properties

Title

Create project asset

URL

/projectassets/

Method

POST



Header

Name

Value

Required

Description

Authorization

Token xxxxx

yes

Authorization token required to communicate with the API.

Content-Typeapplication/jsonnoIf the request body is sent as raw data instead of form-data this header needs to be set as well.

Data Params

Name

Type

Required

Description

name

string

yes

The name of the project asset

bundle_root

string

yes 

Path to the root of the project directory, as seen by medialoopster.

production_idintegeryes/no

Production to add this project asset to, represented by the internal object ID of the production.

Either production_id or production_name is required. If both are provided production_id takes precedence.

production_namestringyes/no

Production to add this project asset to, represented by the name of the production.

Either production_id or production_name is required. If both are provided production_id takes precedence.


Success Response

201 - Created

{
  "id": 1,
  "audio_assets": [],
  "image_assets": [],
  "video_assets": [],
  "name": "Project Asset Name",
  "description": "",
  "date_crt": null,
  "date_add": "2017-05-16T12:50:22.099871Z",
  "date_mod": "2017-05-16T12:50:22.183103Z",
  "date_del": null,
  "meta_field_store": {},
  "status_asset": 6,
  "status_asset_description": "",
  "status_editing": 0,
  "status_approval": 1,
  "path_file": "/path/to/the/project/bundle/project_file.prproj",
  "bundle_root": "/path/to/the/project/bundle/",
  "type": "Adobe Premiere Pro",
  "is_archive": false,
  "is_production": true,
  "files": {},
  "name_editor": "",
  "name_studio": "",
  "locked_by": null,
  "production": 1,
  "device": 5
}

Error Response

400 - Bad Request

{
  "errors": [
    {
      "status": "400",
      "source": {
        "pointer": "/bundle_root"
      },
      "code": "required",
      "detail": "This field is required.",
      "title": "Validation Error"
    },
    {
      "status": "400",
      "source": {
        "pointer": "/name"
      },
      "code": "required",
      "detail": "This field is required.",
      "title": "Validation Error"
    }
  ]
}

Sample Call

curl -X POST http://medialoopster-url/api/projectassets/ \
  -H "Content-Type: application/json" \
  -d '{
        "name": "Project Asset Name",
        "bundle_root": "/path/to/the/project/bundle/",
        "production_id": 1
        "path_file": "/path/to/the/project/bundle/project_file.prproj"
      }'

  Copy Project AssetPOST /projectassets/

Description

Copy a project asset.

The same endpoint and request method is used as for creating a project asset, but the ID of a project asset to be copied is given using the copy_of data parameter.

Preconditions

To copy a project asset, it must be in production (is_production=true).

The user copying the project asset must have the browser.copy_projectasset permission and read access to the project asset's production as well as write access to the target production.

If linked assets are requested to be shared using the share_linked_assets query parameter (see below), the browser.share_production_asset permission is also required.

Workflow

A new project asset is created with all metadata and custom metadata of the copied project asset given as copy_of attribute, whose files are copied asynchronously.

Initially, status_asset is set to 0 (NEW) and will be updated to 6 (ASSET_DONE) after all files have been copied. If there has been an error while copying the project asset's files, its status_asset is set to -1 (ERROR).

The project asset's is_production attribute is set to false while the files are being copied and updated to true after all files have been copied.

All assets, which are linked to the project asset being copied, are linked with the new project asset.

If the share_linked_assets query parameter is set to 1, the linked assets are shared with the target production (see Asset sharing for a description of the asset sharing workflow).

Linked assets in a production to which the user does not have read access, are not shared.

Request format

The request body can either be form-data or raw data. The latter requires "application/json" as a Content-Type header.

Properties

Title

Copy project asset

URL

/projectassets/

Method

POST

Availability

Added in medialoopster 5.3.1



Header

Name

Value

Required

Description

Authorization

Token xxxxx

yes

Authorization token required to communicate with the API.

Content-Typeapplication/jsonnoIf the request body is sent as raw data instead of form-data this header needs to be set as well.

Query Params

NameTypeRequiredDefaultDescription
share_linked_assetsbooleannofalseIf true, all assets linked to the source project asset are shared with the target production.

Data Params

Name

Type

Required

Description

copy_ofintegeryes

The ID of the project asset to copy.

name

string

yes

The name of the project asset

bundle_root

string

yes 

Path to the root of the project directory, as seen by medialoopster. It must be on a Device.

production_idintegeryes/no

Production to add this project asset to, represented by the internal object ID of the production.

Either production_id or production_name is required. If both are provided production_id takes precedence.

production_namestringyes/no

Production to add this project asset to, represented by the name of the production.

Either production_id or production_name is required. If both are provided production_id takes precedence.

descriptionstringno

A short description of the project asset.

If missing, the description of the project asset given in copy_of is used.

date_crtstringno

The date and time when the asset has been created.

If missing, the creation date of the project asset given in copy_of is used.

name_editorstringno

The name of the editor.

If missing, the editor name of the project asset given in copy_of is used.

name_studiostringno

The name of the studio.

If missing, the studio name of the project asset given in copy_of is used.

status_approvalintegerno

The approval status (1 = approved, 0 = pending).

If missing, the approval status of the project asset given in copy_of is used.


Success Response

201 - Created

{
  "id": 1,
  "audio_assets": [],
  "image_assets": [],
  "video_assets": [],
  "name": "Project Asset Name",
  "description": "",
  "date_crt": null,
  "date_add": "2017-05-16T12:50:22.099871Z",
  "date_mod": "2017-05-16T12:50:22.183103Z",
  "date_del": null,
  "meta_field_store": {},
  "status_asset": 0,
  "status_asset_description": "",
  "status_editing": 0,
  "status_approval": 1,
  "path_file": "/path/to/the/project/bundle/project_file.prproj",
  "bundle_root": "/path/to/the/project/bundle/",
  "type": "Adobe Premiere Pro",
  "is_archive": false,
  "is_production": false,
  "files": {},
  "name_editor": "",
  "name_studio": "",
  "locked_by": null,
  "production": 1,
  "device": 5
}

Error Response

400 - Bad Request

{
  "errors": [
    {
      "status": "400",
      "source": {
        "pointer": "/bundle_root"
      },
      "code": "required",
      "detail": "This field is required.",
      "title": "Validation Error"
    },
    {
      "status": "400",
      "source": {
        "pointer": "/name"
      },
      "code": "required",
      "detail": "This field is required.",
      "title": "Validation Error"
    }
  ]
}

Sample Call

curl -X POST http://medialoopster-url/api/projectassets/ \
  -H "Content-Type: application/json" \
  -d '{
        "copy_of": 123,
        "name": "Project Asset Name",
        "bundle_root": "/path/to/the/project/bundle/",
        "production_id": 1
        "path_file": "/path/to/the/project/bundle/project_file.prproj"
      }'

  Add Media Asset to Project AssetPOST /projectassets/{id}/addasset/

Description

Link existing media assets (audio, image or video) to a project asset.

The request body must be sent as JSON formatted raw data.


Properties

Title

Add media asset to project asset

URL

/projectassets/{id}/addasset

Method

POST



Header

Name

Value

Required

Description

Authorization

Token xxxxx

yes

Authorization token required to communicate with the API.

Content-Typeapplication/jsonyesThe request body must be in JSON format, therefor the content type must be set as well.

Data Params

Name

Type

Required

Description

asset_list

array

yes

List of media assets wrapped as JSON objects to link with the project asset:

"asset_list": {
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "asset_id": {
        "description": "The unique identifier of the asset object"
        "type": "integer"
      },
      "type": {
        "description": "The asset object model type"
        "enum": [ "audio", "image", "video" ]
      }
    }
  }
}
silent_modebooleannoIf set to yes, in case of a semantical error, don't stop processing the request. Invalid media asset data will be listed in the response as invalid_assets. Otherwise the server responds with 422 - Unprocessable Entity.

Success Response

200 - OK

{
  "newly_linked_assets": [
    {
      "asset_id": 1,
      "type": "audio"
    }
  ],
  "already_linked_assets": [
    {
      "asset_id": 10,
      "type": "image"
    }
  ]
  "invalid_assets": [
    {
      "asset_id": 20,
      "type": "other"
    }]
}

Error Response

Work in progress!


400 - Bad Request

{
  "detail": "The field 'asset_list' is required to add assets to a project."
}


422 - Unprocessable Entity

{
  "detail": "The provided asset type 'other' at asset list entry at index '0' is not supported. Must be one of 'audio', 'image' or 'video'"
}

Sample Call

curl -X GET http://medialoopster-url/api/projectassets/1/addasset/ \
  -H "Content-Type: application/json" \
  -d '{
        "asset_list": [
          {
            "asset_id": 1,
            "type": "audio"
          },
          {
            "asset_id": 10,
            "type": "image"
          },
          {
            "asset_id": 20,
            "type": "other"
          }
        ]
      }'

  Delete Project AssetDELETE /projectassets/{id}/

Description

Delete a project asset and all of its files. Linked assets are not deleted.

The project asset and its files are deleted asynchronously, because deletion must be performed at the site of the asset's production and the task must be routed to that site.

The request body can either be form-data or raw data. The latter requires "application/json" as a Content-Type header.

Properties

Title

Delete project asset

URL

/projectassets/{id}/

Method

DELETE

Availability

Added in medialoopster 5.3.1



Header

Name

Value

Required

Description

Authorization

Token xxxxx

yes

Authorization token required to communicate with the API.

Content-Typeapplication/jsonnoIf the request body is sent as raw data instead of form-data this header needs to be set as well.

Success Response

202 - Accepted

Error Response

404 - Not Found

{
  "errors": [
    {
      "status": "404",
      "code": "does_not_exist",
      "detail": "The project asset 123 does not exist.",
      "title": "Not Found"
    }
  ]
}

Sample Call

curl -X DELETE http://medialoopster-url/api/projectassets/123/