Access Token
RESTful API uses Hypertext Transfer Protocol (HTTPS) for security. It provides an encrypted HTTPS channel between the client and the server. Token creation is required for authentication.
Creating a token using Curl
You must create a token using POST method before other RESTful API operations can be initiated. It fulfills all security requirements of the RESTful API.
The following example shows how to use CURL for authentication.
curl -k --request POST 'https://ip_address/api/v1/token' --data-raw '{"username":"enter_username","password":"enter_password"}'
This yields an authentication token that you use for all other commands. The response is formatted for clarity.
"data": [
{
"expireTime": "2022-08-23T23:06:04.731Z",
"token": "eyJraWQiOiJwM0pEa2JCUmUtdDNLTEFvcC1idGljTExMekZUeV9nbURrLUFTYkRLcHpVIiwidHlwIjoiSl
dUIiwiYWxnIjoiUlMyNTYifQ.eyJ0b2tlbl90eXBlIjoiQmVhcmVyIiwic3ViIjoiYWRtaW4iLCJvcmlnIjoiQkEwODgiLCJncm91cHMi
OlsiQWRtaW5pc3RyYXRvciJdLCJwb2xpY3kiOiJMb2NhbCIsImlzcyI6ImNsdXN0ZXIwIiwiZXhwIjoxNjYxMjk1OTY0NzMxLCJpYXQiO
jE2NjEyOTI5NjR9.O3wQab9fihoFtAXRJGw6HzzTfE0m_-2QvC9g2KLkYQnEnq_zBfLjg8sxGaR8fQNGN73sSU6NUvFCP0o2KkeZV16Bu
nQav4_HKdhuryzmh6lZktPC7V398EFMu2pHGxsNMifWhANJK0Spak91DrgSZHsaxiQgQXKx0oGIYEVBM8fQdxVNmIg7vYBWNFiKtTz7
1FFbKkRlh5853OKo_-cFs06B2glSHjf8TS8ydMOnvMa1i6A8Ru9SmgTH4W4sQpJIEtVDr2WcPx7Aw69ow9Rd9jg3hQ9Eg-YbPvxceHJ
YSxu7veezpivYdKa55ces-16v_DTlRiNHlnzFE7jytqGGlwcqX2NyJjQ-d6ifS44GMLap3HHAGTZ_DQ"
}
]
When you create a token, a new event will be created as shown in the figure below:

Renewing a token using Curl
You can also use POST method to renew a token. The renewed token builds upon a non-expired, previously retrieved token. NO username or password is required (No parameter is needed).
curl -k --request POST -H "Authorization: Bearer eyJraWQiOiJwM0p..." 'https://ip_address/api/v1/token'
When you renew a token like in the example above, no new event will be created. Instead, it will be added in the Event History area of the event as shown in the figure below:
