Authentication: Best Practice

Katrin Geske
Katrin Geske
  • Updated

When using the babelforce API, there are multiple ways to authenticate. There is an easy but not recommended way and there is a secure way. We'll walk you through both and give our recommendation on what to do, best.

We will start with the recommended way, creating an oauth token via user name and password. Then you will be introduced to using Access ID and Access Token.

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}}' \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --data-urlencode 'username={{}}' \
      --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}}' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer {{mytoken}}' \
      --data-raw ''

Using Access ID and Access Token

  • First, log into babelforce manager and go to this page:
    • https://apps.{{env}}
    • As always, replace the {{env}} if needed. For the main EU region, no environment name is needed
    • Find the Access ID and Access Token there:
    • mceclip0.png
  • This is how you would use these in your curl to get all agents:
    • curl --location --request GET 'https://{{env}}' \
      --header 'X-Auth-Access-Id: {{yourAccessID}}' \
      --header 'X-Auth-Access-Token: {{yourAccessToken}}' \
      --header 'Content-Type: application/json' \
      --data-raw ''



Was this article helpful?




Please sign in to leave a comment.