Get access token

Generate and obtain your access token to start working with our APIs

Before you can work with the EVC-net APIs, you must authenticate your requests. Authentication is handled using OAuth 2.0 access tokens.

Step 1. Generate the Base64 authorization string

When requesting the token, you need to base64-encode your credentials in the following format: client_id:client_secret. It’s best to generate this string locally for security. Use the following commands:

[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("1:$APIKEY"))
echo -n "1:$APIKEY" | base64
  • client_id: This unique identifier (defaulting to 1) can be customized to track which user or system is making the API request. You have the flexibility to choose a value that best suits your environment.
  • $APIKEY : Your API key, required for authentication. You may have received this key via email from our Connectivity department. Alternatively, you can generate it in the System Users section of the EVC-net platform.

The result should look like this:

[System.Convert]::ToBase64String(
    [System.Text.Encoding]::UTF8.GetBytes("1:f222f495-c46f-4829-24ef-442f55888f3e")
)

To get the access token, use the resulting string in the HTTP Authorization header of your request: Authorization: Basic {base64_string}.

You can try working with examples on the Request an access token page: navigate to the upper-right block of code and click Try it.

Step 2. Generate an Access token

To start authenticating, generate an access token by sending a POST request to the following endpoint:

POST /oauth/v2/token

Although most programming languages include libraries that simplify OAuth 2.0 authentication, this example demonstrates how to generate a token manually.

Request example

Make the POST request using the credentials received from our team:

curl --request POST \
     --url https://accp.evc-net.com/oauth/v2/token \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data grant_type=client_credentials
http --form POST https://accp.evc-net.com/oauth/v2/token \
  accept:application/json \
  content-type:application/x-www-form-urlencoded \
  grant_type=client_credentials

Response example

On successful authentication, you’ll receive a JSON payload similar to:

{
  "access_token": "your_access_token",
  "token_type": "Bearer",
  "expires_in": 3600
}
  • access_token: The token you send in the Authorization header
  • token_type: Should always be Bearer
  • expires_in: Number of seconds until the token expires

Save this token, because you'll use it to authorize all your API requests.

Step 3. Use the Access token in requests

To access this resource, you'll need to provide the Authorization header. You can generate this header string using the command prompt or terminal provided by your operating system.

Include the token in your requests in the Authorization header in the following format: Authorization: Bearer {access_token}

Example request with the bearer token

GET https://api.evc-net.com/v1/your-endpoint
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6…