Account API Authentication

Use your account’s API key to instruct Crossbar to create an authentication token to be used on subsequent requests requiring authentication.

Getting your API key from the API:

Use the Account API to get API key for your account:

!!! note Must already be authenticated as a user.

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/api_key
{
   "auth_token":"{AUTH_TOKEN}",
   "data":{
      "api_key":"{API_KEY}"
   },
   "revision":"{REQUEST_ID}",
   "request_id":"{REQUEST_ID}",
   "status":"success"
}

Schema

Provides an auth-token via an Account API key

KeyDescriptionTypeDefaultRequiredSupport Level
api_keyThe Accounts API keystring(64)true

Create

PUT /v2/api_auth

Note:

  • {AUTH_TOKEN}: this is your authentication token to include in future requests
  • {ACCOUNT_ID}: your account’s ID, useful for constructing URIs
  • {OWNER_ID}: the user’s ID of the owner of the credentials used to generate this token
  • {RESELLER_ID}: this account’s reseller account ID, if any.
  • {REQUEST_ID}: useful for debugging requests on your installation
curl -v -X PUT \
    -d '{"data": {"api_key":"{API_KEY}"} }' \
    http://{SERVER}:8000/v2/api_auth
{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "account_id": "{ACCOUNT_ID}",
        "apps": [...],
        "is_reseller": true,
        "language": "en-US",
        "owner_id": "{OWNER_ID}",
        "reseller_id": "{RESELLER_ID}",
    },
    "request_id": "{REQUEST_ID}",
    "revision": "{REVISION}",
    "status": "success"
}

On this Page