> For the complete documentation index, see [llms.txt](https://doc.globalsms.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.globalsms.io/english-how-to/how-to-buy-numbers-using-api/obtain-authentication-code.md).

# Obtain Authentication Code

You will need to obtain an authorization code in order to use API to purchase numbers.

## 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;
