Adding an External ID to an Existing Asset

You can add an external ID to an asset at any time.

To add an external ID to an existing asset:

  1. Use PATCH with the /v2/assets route, the asset ID, and the external_id property in the request body. The following example adds the my_video external ID to the asset with the Y1dTdvMjq9QtOMGrP content ID.
    [PATCH]/v2/assets/Y1dTdvMjq9QtOMGrP{  
       "external_id":"my_video"
    }

    Backlot returns a response similar to the following.

    {  
       "asset_type":"video",
       "duration":0,
       "name":"My Video",
       "preview_image_url":null,
       "created_at":"2011-07-22T18:54:19+00:00",
       "embed_code":"Y1dTdvMjq9QtOMGrP",
       "time_restrictions":null,
       "updated_at":"2011-07-22T18:54:19+00:00",
       "external_id":"my_video",
       "description":null,
       "status":"uploading"
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  2. You can now modify the asset using the external ID. The following example changes the external ID to my_cool_video using the current external ID.
    [PATCH]/v2/assets/my_video{  
       "external_id":"my_cool_video"
    }

    Backlot returns a response similar to the following.

    {  
       "asset_type":"video",
       "duration":0,
       "name":"My Video",
       "preview_image_url":null,
       "created_at":"2011-07-22T18:54:19+00:00",
       "embed_code":"Y1dTdvMjq9QtOMGrP",
       "time_restrictions":null,
       "updated_at":"2011-07-22T18:54:19+00:00",
       "external_id":"my_cool_video",
       "description":null,
       "status":"uploading"
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

Was this article helpful?