Authentication: Best Practice

Katrin Geske
Katrin Geske
  • Updated

Recommended authentication method for the babelforce API

When using the babelforce API, authentication is done using your username (email address) and password.
This is the only supported and recommended method for accessing the API securely.

Make sure to store your credentials safely and never share them in unsecured environments.

Using oauth token

  • You need the username and password of a user with manager rights
  • You then run this command to fetch the token:
    • curl --location --request POST 'https://{{env}}.babelforce.com/oauth/token' \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode 'username={{my@email.org}}' \
      --data-urlencode 'password={{myP@ssword3483}}' \
      --data-urlencode 'grant_type=password'
       
  • You can now access all manager resources
  • Example: Getting all available agents:
    • curl --location --request GET 'https://{{env}}.babelforce.com/api/v2/agents' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer {{mytoken}}' \
      --data-raw ''

 

 

Was this article helpful?

/

Comments

0 comments

Please sign in to leave a comment.