Sign Up and Authenticate
To gain access to IQM's API and its services, you must first sign up and log in to obtain the authentication required to send requests.
The IQM platform uses bearer authentication tokens to authenticate along with an Organization Workspace ID.
- On sign up, a bearer token will be returned in the response along with a refresh token. The access token will remain valid for 24 hours, at which time the refresh token will need to be used to retrieve a new access token.
- On log in, an Organization Workspace ID (owId) will be returned in the response. This ID will be required for all API calls, and to authenticate your access to the platform.
Sign Up
POST /api/v3/ua/sign-upSign up for an account by providing an email address and desired password.
Headers | |
---|---|
Authentication string required | Authentication bearer token |
Request Schema | |
---|---|
email string required | Email address of user |
password string required | Desired password of user |
- JSON
- TypeScript
Request Sample
{
"email": "user1@iqm.com",
"password": "123456"
}
Response 200
{
"success": true,
"data": {
"access_token": "d90fa7de-534c-4652-ad8f-c4f6f70461ac",
"refresh_token": "2e379c6f-959d-498f-8319-ff13ebef6bfe",
"scope": "read write",
"token_type": "bearer",
"expires_in": 35999
}
}
See TypeScript Prerequisites page for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
data: {
access_token: string;
refresh_token: string;
scope: string;
token_type: string;
expires_in: number;
};
};
};
};
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string;
reason: string;
}[];
};
};
};
};
function UserSign-up/PasswordCreation(): Promise < Responses > {
const options = {
method: 'POST',
url: 'https://app.iqm.com/api/v3/ua/sign-up',
requestBody: {
content: {
"application/json": {
email: `string`,
password: `string`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Log In
POST /api/v3/ua/loginOnce a you have created an account, you can log in. This API will send OAuth compliant response with an Organization Workspace ID (owId) which can be used for any further API communications.
Headers | |
---|---|
Authentication string required | Basic |
X-IAA-HOST string required | Workspace URL |
Request Schema | |
---|---|
grantType string required | OAuth Grant Types |
email string required | User account email |
password string required | User account password |
- JSON
- TypeScript
Request Sample
{
"grantType": "password",
"email": "user1@iqm.com",
"password": "123456"
}
Response 200
{
"success": true,
"data": {
"access_token": "106adb25-37b0-4cab-8381-d682fe7cc3c8",
"refresh_token": "eac4c1f6-781e-4b04-baff-9c2e415d1f64",
"scope": "read write",
"token_type": "bearer",
"expires_in": 35999,
"owId": 200001
}
}
See TypeScript Prerequisites page for usage.
import {
getInstance
} from "prerequisites"
const axios = getInstance();
interface Responses {
200: {
content: {
"application/json": {
success: boolean;
data: {
access_token: string;
refresh_token: string;
scope: string;
token_type: string;
expires_in: number;
owId: number;
};
};
};
};
400: {
content: {
"application/json": {
success: boolean;
data: {
status: string;
reason: string;
supportEmail: string;
};
errorObjects: {
error: string;
reason: string;
}[];
};
};
};
403: {
content: {
"application/json": {
success: boolean;
errorObjects: {
error: string;
}[];
};
};
};
};
function Login(): Promise < Responses > {
const options = {
method: 'POST',
url: 'https://app.iqm.com/api/v3/ua/login',
requestBody: {
content: {
"application/json": {
grantType: `string`,
email: `string`,
password: `string`,
}
}
}
};
return axios.request(options).then(({ data }: { data: Responses }) => data);
}
Refresh Token
POST api/oauth/tokenExchange a refresh token for a new access token.
Request Parameters | |
---|---|
grantType string | OAuth Grant Types |
refresh_token string | Refresh token |
Request Sample
{
"grant_type": "refresh_token",
"refresh_token": "eac4c1f6-781e-4b04-baff-9c2e415d1f64"
}
Response 200
{
"success": true,
"data": {
"access_token": "106adb25-37b0-4cab-8381-d682fe7cc3c8",
"refresh_token": "eac4c1f6-781e-4b04-baff-9c2e415d1f64"
}
}