Registering Your Application with BarTender Cloud
Before you can begin working with the BarTender Cloud REST API, you must first register the application you will be using with the API. There are two types of applications you can use with the REST API: web-based and console.
Registering a Web Application (Authorization Code Flow)
The OAuth protocol requires that the client application provide users with a BarTender Cloud sign-in form, and it grants access to only the specific client that the user is signed in to. Seagull recommends that you use the OAuth protocol for web-based applications.
Web applications are built-in languages such as C#. They act as a fully-functioning interface. As these are oftentimes third-party applications and users may not wish to share their credentials directly with it, BarTender Cloud offers this authentication method to allow the application to authenticate without having access to the credentials. These types of applications have extra steps to retrieve a token and ultimately pass through the Security Gate and make API calls. For more information about access tokens, see Access Tokens and the Printer API section of Available BarTender Cloud REST APIs.
To register a web application
-
Click
to open the BarTender Cloud menu, then select Administration and click API Keys.
- In the Web Applications (OAuth) section of the BarTender Cloud API page, click Register Application for OAuth Access.
-
In the Register Web Application dialog, enter the appropriate information.
-
Name (required). The name that you want for the web application. This is the "friendly" display name.
-
Description. A description of the application.
-
Login URI (required). The URI for the Authorization endpoint within your web application to which the user is redirected. For more information on Redirection click here
.
-
Callback List. A list of URLs within your web application to which BarTender Cloud sends its response after authentication. After a user successfully signs in, these URLs redirect to one or more default web pages within your application.
-
Logout URLs. One or more URLs for the endpoints within your web application to which the user is redirected upon logging out.
-
Allowed Origins (CORS). Although not recommended, cross-origin authentication provides a way to embed authentication forms directly in an application. When embedded login is required, an application must be set up for cross-origin resource sharing (CORS). For more information on CORS click here
.
-
Allowed Web Origins. URLs from which cross-origin authentication can be performed. These URLs are typically used with CORS. For more information on cross-origin authentication click here
.
-
Click Register.
Registering a Console Application or Service (Password-Based)
This type of access is required when your application cannot provide users with a BarTender Cloud sign-in form, which is typical for console applications and services that do not have a GUI.
Console applications and services that cannot display a BarTender Cloud login dialog must use password-based authentication. Applications that cannot display a GUI fall into this category. In addition, this method can be used for testing with applications like Insomnia or Postman as it is easier to implement.
Registering a password-based application is a two-step process.
To enable password-based API access
-
Click
to open the BarTender Cloud menu, then select Administration, then Security and click Users.
-
For the user you wish to grant access, click
and select Edit.
-
In the user information dialog, select the Allow password-based API access checkbox.
|
|
The Allow password-based API access and Enable two-factor authentication checkboxes cannot be selected at the same time. If the Enable two-factor authentication checkbox is selected, you must clear it before you can select the Allow password-based API access checkbox for the user.
|
-
Click Save.
To register an application or service for password-based access
-
Click
to open the BarTender Cloud menu, then select Administration and click API Keys.
-
In the Console Applications and Services (Password-Based) section of the BarTender Cloud API page, click Register Application for Password-Based Access.
-
In the Register Password-Based Access dialog, enter a name and description for the application or service.
Fields marked with an asterisk (*) are required.
-
Click Register.
After you register your application, it is listed in a table on the BarTender Cloud API page.
-
Completing registration generates an Application ID and Application Secret. Click
to the right of your registered application and select View ID & Secret to view them.
These are used along with your BarTender Cloud username and password to generate your user access token. You need this token to make BarTender Cloud REST API calls. If you need to change the ID and Secret, select the Rotate ID & Secret button in the Web Registration ID and Secret dialog.
|
|
Password-based authentication should only be enabled on a BarTender Cloud service account created for this purpose. Do not use your personal user account. This authentication process requires sharing your service account's login credentials. You should only use it with trusted applications.
|
Related topics