Postman Chrome For Mac

POSTMAN Introduction. POSTMAN is an API client used to develop, test, share and document APIs. It is used for backend testing where we enter the end-point URL, it sends the request to the server and receives the response back from the server.

Install Postman

Get Postman from www.getpostman.com. Postman can be installed as a Chrome or Mac app. We recommend getting the desktop client, but the Chrome version will run on any platform and is identical in functionality and appearance.

Get client credentials

To work with the Brightcove APIs, you will need client credentials for the account and API(s) you wish to use. Get you client credentials in Studio by following the directions in Managing API Authentication Credentials. In the steps below, we will be making Player Management API requests using Postman, so your credentials should have at least the following permissions:

  • Players: Read/Write

You can add as many additional permissions as you like to get credentials that will be usable for a wider range of API requests. Also note that you get credentials that will work for multiple accounts if you like.

On your Mac, choose Apple menu System Preferences, click Keyboard, then click Shortcuts. Open the Shortcuts pane for me. Select App Shortcuts on the left, click the Add button, click the Application pop-up menu, then choose a specific app or All Applications. For example, to set a shortcut for a TextEdit command, choose TextEdit. Lacks libraries and advanced music player features VLC is a media player first and foremost. There is no library management, aside from playlists, usage of tags is very limited, no rating system and VLC is best at playing a file directly from a folder as opposed to helping you manage or find good songs in your music library. Music player shortcut mac osx. To use a keyboard shortcut, press and hold one or more modifier keys and then press the last key of the shortcut. For example, to use Command-C (copy), press and hold the Command key, then the C key, then release both keys. Mac menus and keyboards often use symbols for certain keys, including modifier keys.

You can use this online app if you prefer. If you do, you need to specify at least video-cloud/player/all permissions.

In order to generate client credentials you must have Admin permissions for the Brightcove account, or get someone in your organization who has Admin permissions to generate the credentials for you.

Using Postman

Once you have your client credentials, you are ready to start using Postman. The steps below will walk you through making some Player Management API requests using Postman.

Setting up Postman to get access tokens

  1. Launch the Postman app.
  2. Create a new request:
  3. In the new request dialog, enter 'Get Players' for the Request Name:
  4. Click Create Collection, and then enter 'Player Management API' for the collection name:
  5. Save the collection.
  6. Find the Player Management API collection in the list on the left and click it to open your new request:
  7. Go to the Authorization tab, choose OAuth 2.0 as the type, and make sure that Add authorization data to Request Headers is selected:
  8. Click Get New Access Token:
  9. In the dialog, enter the following information:
    • Token name: Player Management API
    • Grant Type: Client Credentials
    • Access Token URL: https://oauth.brightcove.com/v4/access_token
    • Client ID: (enter your client id)
    • Client Secret: (enter your client secret)
    • Scope: (leave blank)
    • Client Authentication: Send client credentials in body
  10. Click Request Token
  11. You should see a new access token appear: Note: you may get an error like the one shown below:

For each request you make, you will need to select an access token to use:

Your token will expire after 5 minutes. When it does, your API requests will return an Unauthorized error. When that happens, just click Get New Access Token again. Postman will remember all the information you entered into the dialog before, so you won't have to enter it again. Don't forget you need to select the appropriate token from the Available Tokens list after you create a new one.

Since old tokens are of no value, you'll probably want to keep the list clean by deleting old tokens when you create new ones:

Send GET request

Now we are ready to make API requests.

Make a GET request

  1. Now enter the following URL into the Enter request URL field, substituting your account id for {account_id}:
  2. Leave the method as GET, and click Send:
  3. The response should look something like this: If you get an Unauthorized error, remember that you may need to get a new access token.

Send POST request

Now we will send a POST request with some data. In this case we will create a new player using the Player Management API.

Make a POST request

  1. Duplicate your Get Players request:
  2. Open your new request and rename it 'Create Player'
  3. Use the same URL as you did for the GET request steps above, but now choose POST to be the selected HTTP method.
  4. Click the Body tab just under the URL, then choose the raw radio button and JSON (application/json) from the type dropdown menu:
  5. You may note that a new Header gets automatically added to the request. Requests that send data need a header telling the API what kind of data is being sent. Click the Headers tab to see the Content-Type: application/json header:
  6. For the raw data, enter the following JSON code for the body (the screenshot following the JSON shows how the request should appear):
  7. Click Send. If you have recently submitted a request you may not be asked to authenticate again. If you get an Unauthorized error, request a new access token and click Send again.
  8. Your response will look similar to the following (You can click the Pretty button for more nicely formatted JSON):

  9. You can verify that your player was created by checking in the Players section of Studio.

Environment variables

Although you can create client credentials for multiple accounts and any combination of API operations, you may wish to maintain greater security by limiting the scope of your credentials to a single account and API (or even specific API operations). If so, you can take advantage of Postman's environment variables to simplify testing requests across multiple accounts and APIs. The key is to set up environments corresponding to each set of client credentials that you use.

Below are the steps for creating and using environment variables for the client_id and client_secret .

  1. Click the gear menu in the top-right Postman and select Manage Environments.
  2. In the Manage Environments dialog, click Add to add an environment.
  3. For the new environment, enter:
    • A name (Brightcove APIS, or whatever you like)
    • An environment variable called account_id with a value of your account id
    • An environment variable called client_id with a value of your client id
    • An environment variable called client_secret with a value of your client secret
  4. Click Add to add the environment
  5. Close the Manage Environments dialog to return to Postman and select your environment from the menu.
  6. Now you can start replacing hard-coded values in your requests with variables. To do so, just type {{ anywhere, and a dropdown list of variables will appear:

Create a collection from an API reference

As of version 6.7.4, Postman supports the import of OpenAPI specs to create request collections. Since Brightcove's platform API References are based on the OpenAPI spec, you can use this feature the generate a full collection of requests for any of the Brightcove APIs.

In the steps below, we will use the Dynamic Ingest API as an example, but the procedure will work for any of the Brightcove platform APIs (not for Player API or the mobiles SDKs, because Postman only supports REST APIs).

Steps

  1. In your browser, go to Dynamic Ingest API Reference
  2. Click on the Download button under the title to download the OpenAPI specification for the API:
  3. Depending on which browser you are using, the specification (a YAML file) may download or open in a new browser tab. If it opens in the browser, either copy and paste the contents into a text file, or save the page source to your local drive. The file should be named openapi.yaml.
  4. Now go to Postman and click the Import button at top of the window on the left side:
  5. Drag and drop the openapi.yaml file from your file manager into the import modal that opens:
  6. After Postman processes the file, you will see a new Collection in the list titled Dynamic Ingest API Reference
  7. Drilldown into the folders through accounts/{account id}/video/{video id} and you will see the requests:
  8. Select the POST request to open it. You will find both the Params and the Body pre-populated from the API reference, but you will need to replace placeholders that show the data type with actual data: Note: you will see a number of fields in the request body like the one below:

    In cases like this, the field is an object, and the details of the object were in another part of the OpenAPI specification that was indicated by reference. The Postman importer does not yet correctly follow such references (Brightcove has reported this bug to Postman). For fields like this, you will need to go back to the API Reference to find the properties of the object.

  9. Once you have replaced the placeholders with appropriate values, you can use the request just like ones you created yourself.