POST
/api/v1/apis/token/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/apis/token/?apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "token_name": "api-automation", "access_name": [ "read" ]}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/apis/token/", params={"apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "token_name": "api-automation", "access_name": [ "read", ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/apis/token/");url.search = new URLSearchParams({ apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "token_name": "api-automation", "access_name": [ "read" ] }),});console.log(await response.json());Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”apikey
required
string
API key used to authenticate the request
Example
<API_KEY>location
required
string
Specifies the target location for the API token
Example
<LOCATION>Request Body
Section titled “Request Body”Media typeapplication/json
object
token_name
required
Name of the API token
string
Example
api-automationaccess_name
required
One of:
Array<string>
Array<string>
Example
[ "read", "write"]Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
code
HTTP status code of the token creation request
integer
data
object
token_name
Name of the created API token
string
access_name
Array<string>
api_key
API token identifier
string format: uuid
auth_token
JWT authentication token associated with the API token
string
created_at
Human-readable relative timestamp indicating when the token was created
string
errors
object
message
Status message indicating the result of the request
string
Example
{ "code": 200, "data": { "token_name": "api-automation", "access_name": [ "READ", "WRITE" ], "api_key": "uuid-string", "auth_token": "example-jwt-string", "created_at": "0 Day ago" }, "message": "Success"}