User Flow
To interact with XQ servers and leverage the XQ APIs/SDKs, you'll need General and/or Dashboard API keys. Follow these steps to obtain them:
- Open the XQ Dashboard.
- Authenticate using magic link, Google, or Microsoft authentication.
- Navigate to Applications via the navigation bar on the left-hand side.
Generating API Keys
To generate API keys for the first time, refer to the following steps:
- Enter a name in the Name your application field. Optionally, add a description if needed.
- Click CREATE APPLICATION.
- In the Name of key field, provide a name for your API key.
- From the API dropdown, select either General or Dashboard.
- Optional - Specify a space-delimited list of IP addresses allowed to use this key in the IP Access Restrictions field.
- Click CONTINUE.
- Save your API key in a safe place. Your API key is only visible once.
The Dashboard API key is utilized for the Manage API functionality, while the General API key is utilized for Quantum, Subscription, and Validation API functionalities.
If you need access to multiple features, generate multiple API keys with the corresponding dropdown group in Step 4.
Create API keys for existing applications
To generate API keys for existing applications, refer to the following steps:
- From the XQ Dashboard, click Applications and select your application name.
- In the API KEYS section click ADD A NEW KEY.
- Follow the prompts to create an API key.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, etc.
Authorizing a User
An authorized user is identified by an email address that is granted an authorization token (authToken). This token is used to store and access the protected key.
Parameters — /authorize
| Name | Type | Required | Description |
|---|---|---|---|
api-key | string | Yes | General API key |
user | string | Yes | The email address or phone number of the account to validate. The confirmation link or code will be sent to this address or number |
A successful response includes the Pre-Auth Token that will allow the subscriber to exchange it in conjunction with the 2FA pin received in their email/phone with an authToken. Store the Pre-Auth Token for use in following step of the tutorial.
Parameters — /codevalidation
| Name | Type | Required | Description |
|---|---|---|---|
token | string | Yes | The Pre-Auth token that is returned after an initial request for authorization. |
pin | integer | Yes | The pin that was sent to the users email or phone number. |
A successful response will return a 204 with "No Content" but this will validate your pre-auth token with your 2fa credentials.
Parameters — /exchange
| Name | Type | Required | Description |
|---|---|---|---|
api-key | string | Yes | General API key |
Authorization | string | This is a bearer token required to make most XQ API calls. To get one, a user must first utilize the authorize endpoint, upon which they get a pre-auth token. After they confirm their account utilizing the code-validation endpoint, they can then exchange the pre-auth token in return for an access token to a specific team. | |
b | integer | This is the specific Team ID you are using to exchange your pre-auth token for authorization. If no Team ID is specified, you will automatically be authorized into the Team ID with the lowest index that you have access to. |
A successful response will return a 200 with a new access token which can be used to store and access protected keys in that specific team.
Key Storage & Retrieval
Upon authorization, users gain the ability to securely store and retrieve encryption keys, along with comprehensive management functionality. For a detailed overview, explore our Encryption API Tutorial, Decryption API Tutorial, and a variety of use cases.
Tutorials