Reseller account switching

Introduction

In the Eagle Eye Cloud VMS resellers are able to create end user <<glossary:account>>s for their clients. A reseller can access their end user <<glossary:account>>s to provide various services such as configuration and troubleshooting. The /authorizationTokens API allows a reseller to retrieve a <<glossary:access token>> for a particular end user <<glossary:account>>.

Retrieving an access token for an end user

Follow these steps to retrieve an <<glossary:access token>> for an end user <<glossary:account>>:

🚧

Important

Getting an <<glossary:access token>> for an end user <<glossary:account>> does not void the reseller's <<glossary:access token>>. The reseller can use its own <<glossary:access token>> to log in to its own <<glossary:account>> after the account switching process.

  1. Log in with a reseller <<glossary:account>> by following the regular Login process.
  2. Get a list of <<glossary:account>>s your reseller <<glossary:account>> has access permissions to through the /accounts endpoint.
  3. Retrieve the given end user's token with the following POST request:
curl --location 'https://auth.eagleeyenetworks.com/api/v3.0/authorizationTokens' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Bearer &lt;reseller's access token&gt;" \
--data "{
  'type': 'reseller',
  'targetType': 'account',
  'targetId': '&lt;end-user's account ID&gt;',
  'scopes': [
    'vms.all'
  ]
}"

A sample response to the above request:

{
  "accessToken": "string",
  "expireTimestamp": "2023-06-23T13:26:29.368Z",
  "scopes": [
    "string"
  ]
}