Authentication

The first step in the process of accessing the BarTender Cloud REST API is authentication. This step ensures that your account is accessed only by authorized users.

BarTender Cloud supports two authentication methods that you can use when you want to make calls to the BarTender Cloud REST API. You can use a personal access token, which is automatically provided by the OAuth identity provider for your BarTender Cloud account. Or, you can use a web application, which must be registered with BarTender Cloud.

ClosedAccess Token

An access token takes the place of "user name and password" credentials. Access tokens are long unique alphanumeric strings that provide identifying information about the user who is making the API call and the BarTender Cloud tenant space that the call is going to.

You can add your access token to the script that you write to send API calls to the server, such as cURL commands, PowerShell scripts, and JavaScript scripts. Access tokens expire after 30 days and must be refreshed manually.

ClosedTo view your access token

  1. In the left navigation pane of the Manage Cloud Account view, click BarTender Cloud API to display the BarTender Cloud API property page.

  2. Click View Access Token.

  3. In the Personal Access Token dialog, click Copy Access Token to copy the access token to the Clipboard, and then paste it into a secure location.

ClosedTo refresh your access token

  1. In the left navigation pane of the Manage Cloud Account view, click BarTender Cloud API to display the BarTender Cloud API property page.

  2. Click View Access Token.

  3. In the Personal Access Token dialog, click Refresh Access Token to generate a new access token and automatically copy it to the Clipboard.

  4. Paste the access token into a secure location.

ClosedWeb Application

To use a web application to access the BarTender Cloud REST API, you must first register your web application with BarTender Cloud. Then, BarTender Cloud can recognize and support your application, and you can connect to the BarTender Cloud API endpoints to create your automation scripts. When you use this method, your OAuth access tokens are handled automatically.

You can edit or delete your web applications, and you can also rotate (change) a web application's ID and secret as needed.

ClosedTo register a web application with BarTender Cloud

  1. In the left navigation pane of the Manage Cloud Account view, click BarTender Cloud API to display the BarTender Cloud API property page.

  2. Click Register New Web Application.

  3. In the Register Web Application dialog, complete the following fields:

    • Name: Specifies the name that you want for the web application. This is the "friendly" display name.

    • Description: Specifies the detailed description about the functionality that the web application provides.

    • Login URI: Specifies the URI for your web application's sign-in page, which is the page that BarTender Cloud will use to sign in to your application (for example: https://mycustom-domain.com/login).

    • Callback List: Specifies one or more URLs for BarTender Cloud to call back to after a user is authenticated. After a user successfully signs in, these URLs are the redirects to one or more default web pages within your application.

    • Logout URLs: Specifies one or more URLs for BarTender Cloud to redirect to after the user signs out of the web application.

    • Allowed Origins (CORS): Specifies one or more URLs that can make JavaScript requests to the API.

    • Allowed Web Origins: Specifies one or more origins that are used in cross-origin authentication.

  4. Click Register. The dialog closes, and your newly registered web application is listed on the BarTender Cloud API property page.

ClosedTo view the application ID and secret

After you register a web application, you can view the application ID and secret.

  1. In the web application list, point to the application that you want, click , and then click View ID and Secret.

  2. In the Web Registration ID and Secret dialog, click for the application ID and secret to copy them to the Clipboard, and then paste them into a secure location.

  3. Click Close.

ClosedTo rotate the application ID and secret

  1. In the web application list, point to the application that you want, click , and then click View ID and Secret.

  2. In the Web Registration ID and Secret dialog, click Rotate ID and Secret. The dialog closes, and a message is displayed telling you that a new ID and secret have been created.

  3. In the web application list, point to the application, click , and then click View ID and Secret.

  4. In the Web Registration ID and Secret dialog, click for the application ID and secret to copy them to the Clipboard, and then paste them into a secure location.

  5. Click Close.

ClosedTo edit an existing web application

  1. In the web application list, point to the application that you want, click , and then click Edit.

  2. Make the edits that you want, and then click Save.

ClosedTo delete an existing web application

  1. In the web application list, point to the application that you want, click , and then click Delete.

  2. In the Delete Web Application Registration dialog, click Delete Registration.

Related Topics