---
description: >-
  You will need to obtain an authorization code in order to use API to purchase
  numbers.
---

# Obtain Authentication Code

## auth

<mark style="color:blue;">`GET`</mark> `https://api.globalsms.io/api_gsim/v1/auth`

#### Headers

| Name     | Type   | Description                                |
| -------- | ------ | ------------------------------------------ |
| username | string | This is the login you use in UI portal.    |
| password | string | This is the password you use in UI portal. |

{% tabs %}
{% tab title="200  OK" %}
```
{
  "success": true,
  "data": {
    "access": "eyJhbGcinJlZ2lzdGVyZWRfb24iOm51bGwsImRlbGV0ZWudWxsLCJpc19zdXBlcnVzZXIiOm51bGwsImlzX3Jlc2VsbGVyIjpudWxsLCJyZXNlbGxlcl91dWlkIjpudWxsLCJpYXQiOjE3MTkzMzAzMDQsImV4cCI6MTcxOTQxNjc"
  }
}
```
{% endtab %}

{% tab title="404 Account Not Found" %}
```
{
  "statusCode": 400,
  "message": "Wrong password",
  "error": "Bad Request"
}
```
{% endtab %}
{% endtabs %}

## Example

<pre><code><strong>curl -X 'POST'  
</strong>  'https://api.globalsms.io/api/auth/login'  
  -H 'accept: */*'  
  -H 'Content-Type: application/json'  
  -d '{
  "email": "your@mail.com",
  "password": "1234567890"
}'
</code></pre>

&#x20;
