How to get a bearer token for the MSP portal API

The API uses OAuth 2.0 client_credentials flow for authentication and the OIDC protocol is supported.

Auth-related endpoints can be discovered through https://login.backup.net/.well-known/openid-configuration.

Superusers will need to generate client_id and client_secret to be used for authentication, which can be created in the portal UI.

pic.png

Obtain client_id and client_secret from the MSP portal (portal.backup.net) via Settings -> Public APIs -> New:

To get an access token use the below API endpoint.

POST https://login.backup.net/connect/token 

Using the body as follows:

Key Value
grant_type client_credentials
client_id <client id obtained from MSP portal>
username <client secret obtained from the MSP portal>

Here is an example of the authentication request:

POST /connect/token HTTP/1.1
Host: login.backup.net
Content-Type: application/x-www-form-urlencoded

client_id=65e25…
&client_secret=8c1156bb068945efa…
&grant_type=client_credentials

Here's an example of the access_token that will be used for further API request created from above:

GET /v1/customers HTTP/1.1
Host: public-api.backup.net
Authorization: Bearer <YOUR ACCESS_TOKEN HERE>

For more information, please review the public API documentation that can be found on Swagger

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Contact us
Provide feedback for the Documentation team!