> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

# Create application token

POST https://cdn.emnify.net/api/v1/application_token
Content-Type: application/json

Required permissions Beta [Learn more](/developers/api-guidelines/permissions#how-permissions-work)`ApplicationToken` + `Create`Roles: AdministratorCreates a new application token.
ID must not be specified, as it is auto-generated and returned in case of a successful JSON response.
You can provide following fields with this request:- `description` (String, optional)
- `expiry_date` with optional time + time zone (String, optional)
- `ip` - IP Address in CIDR notation (String, optional)

Reference: https://docs.emnify.com/developers/api/application-tokens/application-token-post

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Body (application/json)

This endpoint expects an object.

- `description` (string, optional)
- `expiry_date` (string, optional)
- `ip` (string, optional)

## Response

### 200

Success

- `application_token` (string, optional)

## Errors

### 403 Forbidden Error

Your role doesn't include the permission this endpoint requires. Most endpoints return `error_code`, `error_token`, and `message`. Some return only `status_code` and `message`.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `status_code` (integer, optional)
- `message` (string, optional)

### 422 Unprocessable Entity Error

Unprocessable Entity. See HTTP response body for details.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `message` (string, optional)

## Examples

### Application tokens_ApplicationTokenPost_example

**Response**

```json
{
  "application_token": "KAOp24TuMgjO2FpZmZ3ZFjSqpk7ea_mY8H2daMlMXF-lRbmMzLeQwSEX67-NFczI3GgHcHpCKTfAw"
}
```

**SDK Code**

```python Application tokens_ApplicationTokenPost_example
import requests

url = "https://cdn.emnify.net/api/v1/application_token"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Application tokens_ApplicationTokenPost_example
const url = 'https://cdn.emnify.net/api/v1/application_token';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Application tokens_ApplicationTokenPost_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/application_token"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Application tokens_ApplicationTokenPost_example
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/application_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Application tokens_ApplicationTokenPost_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/application_token")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Application tokens_ApplicationTokenPost_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/application_token', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Application tokens_ApplicationTokenPost_example
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/application_token");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Application tokens_ApplicationTokenPost_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/application_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Basic

**Request**

```json
{
  "description": "My Token"
}
```

**Response**

```json
{
  "application_token": "KAOp24TuMgjO2FpZmZ3ZFjSqpk7ea_mY8H2daMlMXF-lRbmMzLeQwSEX67-NFczI3GgHcHpCKTfAw"
}
```

**SDK Code**

```python Basic
import requests

url = "https://cdn.emnify.net/api/v1/application_token"

payload = { "description": "My Token" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Basic
const url = 'https://cdn.emnify.net/api/v1/application_token';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"My Token"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Basic
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/application_token"

	payload := strings.NewReader("{\n  \"description\": \"My Token\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Basic
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/application_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"My Token\"\n}"

response = http.request(request)
puts response.read_body
```

```java Basic
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/application_token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"My Token\"\n}")
  .asString();
```

```php Basic
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/application_token', [
  'body' => '{
  "description": "My Token"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Basic
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/application_token");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"My Token\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Basic
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["description": "My Token"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/application_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### IP Restricted

**Request**

```json
{
  "description": "Token with IP restriction",
  "ip": "10.203.23.78/32"
}
```

**Response**

```json
{
  "application_token": "KAOp24TuMgjO2FpZmZ3ZFjSqpk7ea_mY8H2daMlMXF-lRbmMzLeQwSEX67-NFczI3GgHcHpCKTfAw"
}
```

**SDK Code**

```python IP Restricted
import requests

url = "https://cdn.emnify.net/api/v1/application_token"

payload = {
    "description": "Token with IP restriction",
    "ip": "10.203.23.78/32"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript IP Restricted
const url = 'https://cdn.emnify.net/api/v1/application_token';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"Token with IP restriction","ip":"10.203.23.78/32"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go IP Restricted
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/application_token"

	payload := strings.NewReader("{\n  \"description\": \"Token with IP restriction\",\n  \"ip\": \"10.203.23.78/32\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby IP Restricted
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/application_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"Token with IP restriction\",\n  \"ip\": \"10.203.23.78/32\"\n}"

response = http.request(request)
puts response.read_body
```

```java IP Restricted
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/application_token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"Token with IP restriction\",\n  \"ip\": \"10.203.23.78/32\"\n}")
  .asString();
```

```php IP Restricted
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/application_token', [
  'body' => '{
  "description": "Token with IP restriction",
  "ip": "10.203.23.78/32"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp IP Restricted
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/application_token");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"Token with IP restriction\",\n  \"ip\": \"10.203.23.78/32\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift IP Restricted
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "description": "Token with IP restriction",
  "ip": "10.203.23.78/32"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/application_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Expiry Date

**Request**

```json
{
  "description": "Token with expiry date",
  "expiry_date": "2021-05-29T00:00:00.000Z"
}
```

**Response**

```json
{
  "application_token": "KAOp24TuMgjO2FpZmZ3ZFjSqpk7ea_mY8H2daMlMXF-lRbmMzLeQwSEX67-NFczI3GgHcHpCKTfAw"
}
```

**SDK Code**

```python Expiry Date
import requests

url = "https://cdn.emnify.net/api/v1/application_token"

payload = {
    "description": "Token with expiry date",
    "expiry_date": "2021-05-29T00:00:00.000Z"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Expiry Date
const url = 'https://cdn.emnify.net/api/v1/application_token';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"Token with expiry date","expiry_date":"2021-05-29T00:00:00.000Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Expiry Date
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/application_token"

	payload := strings.NewReader("{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T00:00:00.000Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Expiry Date
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/application_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T00:00:00.000Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java Expiry Date
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/application_token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T00:00:00.000Z\"\n}")
  .asString();
```

```php Expiry Date
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/application_token', [
  'body' => '{
  "description": "Token with expiry date",
  "expiry_date": "2021-05-29T00:00:00.000Z"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Expiry Date
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/application_token");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T00:00:00.000Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Expiry Date
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "description": "Token with expiry date",
  "expiry_date": "2021-05-29T00:00:00.000Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/application_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Expiry Date and Time

**Request**

```json
{
  "description": "Token with expiry date",
  "expiry_date": "2021-05-29T13:04:49.000Z"
}
```

**Response**

```json
{
  "application_token": "KAOp24TuMgjO2FpZmZ3ZFjSqpk7ea_mY8H2daMlMXF-lRbmMzLeQwSEX67-NFczI3GgHcHpCKTfAw"
}
```

**SDK Code**

```python Expiry Date and Time
import requests

url = "https://cdn.emnify.net/api/v1/application_token"

payload = {
    "description": "Token with expiry date",
    "expiry_date": "2021-05-29T13:04:49.000Z"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Expiry Date and Time
const url = 'https://cdn.emnify.net/api/v1/application_token';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"Token with expiry date","expiry_date":"2021-05-29T13:04:49.000Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Expiry Date and Time
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/application_token"

	payload := strings.NewReader("{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Expiry Date and Time
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/application_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java Expiry Date and Time
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/application_token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\"\n}")
  .asString();
```

```php Expiry Date and Time
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/application_token', [
  'body' => '{
  "description": "Token with expiry date",
  "expiry_date": "2021-05-29T13:04:49.000Z"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Expiry Date and Time
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/application_token");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"Token with expiry date\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Expiry Date and Time
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "description": "Token with expiry date",
  "expiry_date": "2021-05-29T13:04:49.000Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/application_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Full Example

**Request**

```json
{
  "description": "My Application Token",
  "expiry_date": "2021-05-29T13:04:49.000Z",
  "ip": "10.203.23.78/32"
}
```

**Response**

```json
{
  "application_token": "KAOp24TuMgjO2FpZmZ3ZFjSqpk7ea_mY8H2daMlMXF-lRbmMzLeQwSEX67-NFczI3GgHcHpCKTfAw"
}
```

**SDK Code**

```python Full Example
import requests

url = "https://cdn.emnify.net/api/v1/application_token"

payload = {
    "description": "My Application Token",
    "expiry_date": "2021-05-29T13:04:49.000Z",
    "ip": "10.203.23.78/32"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Full Example
const url = 'https://cdn.emnify.net/api/v1/application_token';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"My Application Token","expiry_date":"2021-05-29T13:04:49.000Z","ip":"10.203.23.78/32"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Full Example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://cdn.emnify.net/api/v1/application_token"

	payload := strings.NewReader("{\n  \"description\": \"My Application Token\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\",\n  \"ip\": \"10.203.23.78/32\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Full Example
require 'uri'
require 'net/http'

url = URI("https://cdn.emnify.net/api/v1/application_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"description\": \"My Application Token\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\",\n  \"ip\": \"10.203.23.78/32\"\n}"

response = http.request(request)
puts response.read_body
```

```java Full Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://cdn.emnify.net/api/v1/application_token")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"description\": \"My Application Token\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\",\n  \"ip\": \"10.203.23.78/32\"\n}")
  .asString();
```

```php Full Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://cdn.emnify.net/api/v1/application_token', [
  'body' => '{
  "description": "My Application Token",
  "expiry_date": "2021-05-29T13:04:49.000Z",
  "ip": "10.203.23.78/32"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Full Example
using RestSharp;

var client = new RestClient("https://cdn.emnify.net/api/v1/application_token");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"description\": \"My Application Token\",\n  \"expiry_date\": \"2021-05-29T13:04:49.000Z\",\n  \"ip\": \"10.203.23.78/32\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Full Example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "description": "My Application Token",
  "expiry_date": "2021-05-29T13:04:49.000Z",
  "ip": "10.203.23.78/32"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://cdn.emnify.net/api/v1/application_token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```