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.
Client ID and Client Secret
Before you can sign up or log in with the IQM API, you will need to request a Client ID and Client Secret by emailing support@iqm.com. Once you have obtained these credentials they will be used as the header authorization for signing up and logging in. The header is formed like this: client_id:client_secret base64.
Read more about Client ID and Secret at OAuth.
Sign Up
POST /api/v3/ua/sign-upSign up for an account by providing an email address and desired password.
Headers | |
---|---|
Authentication string required | Client ID and Client Secret |
Request Schema | |
---|---|
email string required | Email address of user |
password string required | Desired password of user |
- JSON
- TypeScript
{
"email": "user1@iqm.com",
"password": "123456"
}
{
"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://api.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/oauth/tokenOnce 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 | Client ID and Client Secret |
Request Schema | |
---|---|
grantType string required | password for login OAuth Grant Types |
email string required | User account email |
password string required | User account password |
- JSON
- TypeScript
{
"grantType": "password",
"email": "user1@iqm.com",
"password": "123456"
}
{
"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://api.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/v3/ua/oauth/tokenUse a refresh token to get a new access token.
Request Schema | |
---|---|
grantType string | OAuth Grant Types |
refresh_token string | Refresh token |
{
"grant_type": "refresh_token",
"refresh_token": "eac4c1f6-781e-4b04-baff-9c2e415d1f64"
}
{
"access_token": "106adb25-37b0-4cab-8381-d682fe7cc3c8",
"refresh_token": "eac4c1f6-781e-4b04-baff-9c2e415d1f64",
"scope": "read write",
"token_type": "bearer",
"expires_in": 35999
}