# antMan REST API

{% hint style="warning" %}
The antMan REST API may change at any time.&#x20;
{% endhint %}

You can view the swagger-ui using the following url

```
http://myantsle.local/swagger-ui
```

If you have renamed your Antsle, replace 'myantsle' in the URL with the name of your antsle - or the antsles private IP address.\
\&#xNAN;*The URL (localhost:4444) in the following images is unique to our lab setup. AntMan is actually listening on port 3000.*

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-M-Bd3X9a0s-ak0u9o3k%2F-M-BdxRZ6CTmN31CiMQQ%2Fswagger-ui.png?alt=media\&token=1fdf2a8f-ce51-44f4-9ddb-c99631fd3cf8)

First you need to authenticate and receive an access token

Open the 'auth' section

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-M-Bd3X9a0s-ak0u9o3k%2F-M-Be-9B4HPftfGnBqLe%2Frest-auth.png?alt=media\&token=679babad-2502-44a6-bb06-a9f1d8eb7e4a)

And open the /api/login section\
&#x20;Click in the 'Example Value' box to populate the 'Bodyxxx' field.\
Edit the values of the json object with your antlse's username and password.\
Click 'Try it out!'

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-M-Bd3X9a0s-ak0u9o3k%2F-M-Be254zmEkmgeOheC3%2Frest-auth-login.png?alt=media\&token=3980cf4c-a958-4b2e-9823-fe9f2a0cdb63)

This will give you an example cURL command to authenticate and retrieve an access token.\
The 'Response Body' field contains your access token

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-M-Bd3X9a0s-ak0u9o3k%2F-M-Be4VxjDcjuu_U76DY%2Frest-auth-login-tryitout.png?alt=media\&token=ad03bc90-3c7b-45c1-9a60-1a54eced2ef0)

In subsequent calls you would add an 'Authorization' header to the cURL command with your access token.

```
--header 'Authorization: Token eyJhbGciO...'
```

```
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/octet-stream' --header 'Authorization: Token eyJhbGciO...' 
```
