We use cookies (just for analytics) on this website. If you continue we will assume you are happy with it. ok

BeBanjo

Back to index

Asset

Assets are each of the materials that need to be in place or that must be received in order for a job to be processed. An asset belongs to a job. It has no child resources.

Here is what its XML looks like:

<asset>
  <type-name>feature_film</type-name>
  <status>pending</status>
  <progress type="integer">80</progress>
  <link href="https://sequence.example.com/api/work_areas/10/jobs/27188/assets/44804" rel="self"></link>
  <link href="https://sequence.example.com/api/work_areas/10/jobs/27188" rel="job"></link>
</asset>

Valid attributes

  • type-name (string, read/write): This is the name of the asset. It can be any string (like a material ID, for instance). Sequence will recognize these generic strings and will translate them appropriately to English or Spanish, depending what language you use when accessing the application via the browser. The system will recognize:

    • box_art
    • feature_film
    • making_of
    • metadata
    • music_cue_sheets
    • subtitles
    • trailer
    • transcript
  • status (string, read/write): This is the status of a specific asset. It can be in one of these four states:

    • pending: This is the initial state of an asset, when it has not been checked yet. An asset with this status should be considered not completed (it will appear as unchecked in the UI).

    • received: When an asset is checked (either because it has been received or because it has been generated). An asset with this status should be considered completed (it will appear as checked in the UI).

    • claimed: When an asset is running late and it is specifically requested to the content provider, the status will be claimed. This normally happens when issuing an email request through Sequence. An asset with this status should be considered not completed (it will appear as unchecked in the UI).

    • expecting\_replacement: When an asset has been received and it is faulty, the operator can choose to request a new one; the status then turns to expecting\_replacement. An asset with this status should be considered not completed (it will appear as unchecked in the UI).

    • sent: When an asset has been generated and its delivery has been notified, the status turns to ‘sent’. An asset with this status should be considered completed (it will appear as checked in the UI).

  • progress (integer, read/write, optional): A value from 0-100 indicating when the asset is pending, it’s progress in the way of being received. It’s optional, so if there’s no progress associated with the asset, this attribute will not be displayed in the XML.

Creating an asset

In order to add an asset to a specific job, it is necessary to issue a POST request to the assets list of a job. The URL for the request would look something like this:

https://sequence.example.com/api/work_areas/10/jobs/27188/assets

The attributes that can be used to create an asset are:

  • type-name (required)
  • status (optional)

Here is an example using curl:

$ curl --digest -u robot_user -H "Content-Type: application/xml" -d @asset.xml https://sequence.example.com/api/work_areas/10/jobs/27188/assets

This line would issue a POST request to the URL specified at the end using digest authentication. It is also setting the HTTP header Content-Type: application/xml (required) and is sending the contents of the file asset.xml as the body of the request. This is what the body of the POST request should look like:

<asset>
  <type-name>S12340001</type-name>
</asset>

If successfully created, the response will be the complete XML of the new job with an HTTP status code of 200:

<asset>
  <type-name>S12340001</type-name>
  <status>pending</status>
  <link href="https://sequence.example.com/api/work_areas/10/jobs/27188/assets/44809" rel="self"></link>
  <link href="https://sequence.example.com/api/work_areas/10/jobs/27188" rel="job"></link>
</asset>

Updating an asset

To update an asset, it is necessary to issue a PUT request to the URL of a given asset. The body of the request should contain the XML of the asset with the changed attributes. Note that not all attributes must be included, it would be enough to include the attributes that we wish to update.

The following example updates the status of the previous asset. Note how the URL used now is the one that uniquely identifies the asset:

$ curl --digest -u robot_user -H "Content-Type: application/xml" -X PUT -d @asset_update.xml https://sequence.example.com/api/work_areas/10/jobs/27188/assets/44809

This is what the body of the request would contain:

<asset>
  <status>received</status>
</asset>

If the request is successful, it should return the updated asset XML and a status code of 200:

<asset>
  <type-name>S12340001</type-name>
  <status>received</status>
  <link href="https://sequence.example.com/api/work_areas/10/jobs/27188/assets/44809" rel="self"></link>
  <link href="https://sequence.example.com/api/work_areas/10/jobs/27188" rel="job"></link>
</asset>

Deleting an asset

In order to DELETE an asset, it is only necessary to issue a DELETE request to the asset URL, like so:

$ curl --digest -u robot_user -H "Content-Type: application/xml" -X DELETE https://sequence.example.com/api/work_areas/10/jobs/27188/assets/44809

The response should be a 204 (no content) HTTP Status code, with no body.

Last updated July 07th, 2017.