support Contact Support | system status System Status
Page Contents

    Quick Start: Ingest Profiles API

    In this topic, you will learn how to use the Ingest Profiles API to manage ingest and transcode profiles for your account. This tutorial will walk you through these operations.

    Introduction

    The Ingest Profiles API allows you to:

    • Get the profiles for your account

    • Create new profiles

    • Update profiles

    • Delete profiles

    • Set or update the default profile for your account

    A Restful API

    The Ingest Profiles API is a RESTful API. It accepts HTTPS requests and returns a JSON response.

    This means that you can use the API with any language you choose - Ruby, Java, PHP, Python, JavaScript (via AJAX or nodejs), etc. All you have to be able to do is make HTTPS requests and handle a JSON response.

    The base URL

    The base URL for the Ingest Profiles API is:

        https://ingestion.api.brightcove.com/v1

    Authorization

    API calls are authorized using OAuth2 access tokens. The token is passed with requests in an authorization header:

        Authorization: Bearer {access_token}

    Access tokens are short-lived (5 min), so you must get one each time you make a request

    In these exercises, we'll make requests via a proxy that will fetch an access token and then make the request.

    Setup for the Exercises

    Setup

    You have two options:

    • Perform the exercises on a sample account (recommended)
    • Use your own account

    Getting all profiles

    Getting the account profiles

    To get all the profiles for an account, make a GET request to the endpoint:

        /accounts/{account_id}/profiles

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/profiles

    Exercise 1: Get all profiles

    Make the following GET request:

    Creating a profile

    Creating profiles

    To create a profile, make a POST request to the endpoint:

        /accounts/{account_id}/profiles

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/profiles

    The JSON for the profile is included as the request body. See the Profile Field Reference for profile, rendition, and DRM package fields

    Exercise 2: Create a profile

    Make the following POST request:

    (Response will appear on the next slide)

    Exercise 2 Response

    Getting a Single Profile

    Getting a profile by id

    To retrieve a profile by id, make a GET request to the endpoint:

        /accounts/{account_id}/profiles/{profile_id}

    For the profile_id, you can use either the:

    • name (e.g. balanced-high-definition)
    • generated id (e.g. 54de14cce4b0a6d2bf9cb08a)

    Examples:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/profiles/screencast
        https://ingestion.api.brightcove.com/v1/accounts/57838016001/profiles/54de14cce4b0a6d2bf9cb08a

    Exercise 3: Get one profile

    Make the following GET request to get back the profile you created:

    Updating a Profile

    Update a profile by id

    To update a profile by id, make a PUT request to the endpoint:

        /accounts/{account_id}/profiles/{profile_id}

    For the profile_id, you can use either the:

    • name (e.g. balanced-high-definition)
    • generated id (e.g. 54de14cce4b0a6d2bf9cb08a)

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/profiles/my-test-profile

    Include the profile data in the request body as you did when you created the profile. The profile data must include the id for the profile!

    Exercise 4: Update profile

    Make the following PUT request to update the profile you created (the description will be updated):

    (Response will appear on the next slide)

    Exercise 4 Response

    Deleting a Profile

    Delete a profile by id

    To delete a profile by id, make a DELETE request to the endpoint:

        /accounts/{account_id}/profiles/{profile_id}

    For the profile_id, you can use either the:

    • name (e.g. balanced-high-definition)
    • generated id (e.g. 54de14cce4b0a6d2bf9cb08a)

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/profiles/my-test-profile

    Exercise 5: Delete profile

    Make the following DELETE request to update the profile you created (cannot be undone!):

    Getting Default Profile

    Get the default profile

    To get the default profile for the account, make a GET request to the endpoint:

        /accounts/account_id/configuration

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/configuration
                            

    Exercise 6: Get default profile

    Make the following GET request to get the default profile for the account:

    Setting Default Profile

    Set the default profile

    To set the default profile for the account, make a POST request to the endpoint:

        /accounts/account_id/configuration

    Include this JSON as the request body

        {
          "account_id": {account_id},
          "default_profile_id": {default_profile_id}
        }

    As with other operations you can use the name or id for the profile_id.

    • name (e.g. balanced-high-definition)
    • generated id (e.g. 54de14cce4b0a6d2bf9cb08a)

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/configuration
                            

    Exercise 7: Set default profile

    Make the following POST request to set the default profile (note that this will fail if the account already has a default profile - we will update the default in the next exercise):

    (Response will appear on the next slide)

    Exercise 7 Response

    Updating Default Profile

    Update the default profile

    To update the default profile for the account, make a PUT request to the endpoint:

        /accounts/account_id/configuration

    Include this JSON as the request body

        {
          "id": {configuration_id},
          "account_id": {account_id},
          "default_profile_id": {default_profile_id}
        }

    The configuration id is returned when you get the default profile. If there is no default profile, see Setting the Default Profile. As with other operations you can use the name or id for the profile_id.

    • name (e.g. high-resolution)
    • generated id (e.g. 54de14cce4b0a6d2bf9cb08a)

    Example:

        https://ingestion.api.brightcove.com/v1/accounts/57838016001/configuration
                            

    Exercise 8: Update default profile

    Make the following PUT request to update the default profile for the account:

    (Response will appear on the next slide)

    Exercise 8 Response


    Page last updated on 12 Jun 2020