Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 0 additions & 193 deletions docs/guidelines/user-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,199 +31,6 @@ Use the following header parameters for all requests:

## Authentication

### Login

<CopyUrl method="POST" url="https://api.iqm.com/api/v3/ua/login" operationId="login" />

<div class="endpoint-container">
<div class="child1">

Log in to the IQM platform with your email and password, and grant type set to <var>password</var>.

| Request schema | |
| ---- | --- |
| `grantType` <br /><span class="type-text">string</span> | [OAuth Grant Types<ExternalLink />](https://oauth.net/2/grant-types/). |
| `email` <br /><span class="type-text">string</span> | User's email. |
| `password` <br /><span class="type-text">string</span> | User's password. |

<details className="objectPropertiesDetails" style={{ maxWidth: "100%", padding: "1rem" }}>
<summary style={{fontSize: "16px"}}>Response properties</summary>

<table className="objectProperties">
<tr>
<td>`success` <br /><span class="type-text">boolean</span></td>
<td>Indicates user successfully logged in: <var>true</var>.</td>
</tr>
<tr>
<td>`access_token` <br /><span class="type-text">string</span></td>
<td>Access token.</td>
</tr>
<tr>
<td>`refresh_token` <br /><span class="type-text">string</span></td>
<td>Refresh token.</td>
</tr>
<tr>
<td>`scope` <br /><span class="type-text">string</span></td>
<td>User access rights.</td>
</tr>
<tr>
<td>`token_type` <br /><span class="type-text">string</span></td>
<td>Token type.</td>
</tr>
<tr>
<td>`expires_in` <br /><span class="type-text">integer</span></td>
<td>Time until token expires.</td>
</tr>
<tr>
<td>`owId` <br /><span class="type-text">integer</span></td>
<td>Organization Workspace ID.</td>
</tr>
</table>
</details>

</div><div class="child2">

<Tabs>
<TabItem value="JSON" label="JSON" default>

```json title="Request sample"
{
"grantType": "password",
"email": "pratik.t+ihp@iqm.com",
"password": "123456"
}
```

```json title="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
}
}
```

<details className="objectPropertiesDetails" style={{ maxWidth: "100%", padding: "1rem" }}>
<summary style={{fontSize: "16px"}}>More responses</summary>

```json title="Response 400"
{
"success": false,
"data": {
"status": "On Hold",
"reason": "The particular account is kept on hold due to missed payment dates for last 3 months.",
"supportEmail": "support@iqm.com"
},
"errorObjects": [
{
"error": "User is not allowed to access provided customer",
"reason": "User is not associated with any active organization."
}
]
}
```

```json title="Response 403"
{
"success": false,
"errorObjects": [
{
"error": "User doesn't exist or user is not allowed to provided workspace."
}
]
}
```

</details>

</TabItem>
<TabItem value="TypeScript" label="TypeScript">

See [TypeScript prerequisites](/getting-started/typescript-prerequisites.mdx) for usage.

```ts
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);
}
```

</TabItem></Tabs>

</div></div>

---

### OAuth token

<CopyUrl method="POST" url="https://api.iqm.com/api/v3/ua/oauth/token" operationId="oauthToken" />
Expand Down
81 changes: 3 additions & 78 deletions docs/quickstart-guides/authentication-quickstart-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ The response includes an access token, refresh token, and the Organization Works

| Request Schema | |
| ---- | --- |
| `grantType` <br /><span class="type-text">string</span> <span class="required-text">required</span> | <var>password</var> for login <br />[OAuth Grant Types<ExternalLink />](https://oauth.net/2/grant-types/) |
| `email` <br /><span class="type-text">string</span> <span class="required-text">required</span> | User account email |
| `grant_type` <br /><span class="type-text">string</span> <span class="required-text">required</span> | <var>password</var> for login <br />[OAuth Grant Types<ExternalLink />](https://oauth.net/2/grant-types/) |
| `username` <br /><span class="type-text">string</span> <span class="required-text">required</span> | User account email |
| `password` <br /><span class="type-text">string</span> <span class="required-text">required</span> | User account password |

</div><div class="child2">
Expand Down Expand Up @@ -188,81 +188,6 @@ curl -i --location 'https://api.iqm.com/api/v3/ua/oauth/token' \
}
```

</TabItem>
<TabItem value="TypeScript" label="TypeScript">

See [TypeScript Prerequisites](/getting-started/typescript-prerequisites.mdx) page for usage.

```ts
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);
}
```

</TabItem></Tabs>

</div></div>
Expand All @@ -283,7 +208,7 @@ Use a refresh token to get a new access token. This endpoint accepts a URL encod

| Request Schema | |
| --- | --- |
| `grantType` <br /><span class="type-text">string</span> | <var>refresh_token</var> to get a new access token<br />[OAuth Grant Types<ExternalLink />](https://oauth.net/2/grant-types/) |
| `grant_type` <br /><span class="type-text">string</span> | <var>refresh_token</var> to get a new access token<br />[OAuth Grant Types<ExternalLink />](https://oauth.net/2/grant-types/) |
| `refresh_token` <br /><span class="type-text">string</span> | Refresh token |

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart-guides/bid-model-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Create a Bid Model with this in-depth tutorial using IQM's API.

The following endpoints are used to check a campaign's eligibility and create a Bid Model:

<CopyUrl method="POST" url="https://api.iqm.com/api/v3/ua/login" />
<CopyUrl method="POST" url="https://api.iqm.com/api/v3/ua/oauth/token" />
<br /><CopyUrl method="GET" url="https://api.iqm.com/api/v2/cmp/campaign/{campaignId}" />
<br /><CopyUrl method="GET" url="https://api.iqm.com/api/v3/cmp/io/advanced/list" />
<br /><CopyUrl method="GET" url="https://api.iqm.com/api/v3/bm/static/dimensions" />
Expand Down
Loading
Loading