Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import device API documentation #107

Merged
merged 9 commits into from
Sep 1, 2023
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
1 change: 0 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ mdx = md
BasedOnStyles = Microsoft,Adjust
BlockIgnores = (?s) *(<Guilabel>.*?</Guilabel>), \
(?s) *(<MenuSelection>.*?</MenuSelection>), \
(?s) *<(.*?)>, \
(?s) *(\x60\x60\x60[a-z]*[\s\S]*?\n\x60\x60\x60)
15 changes: 15 additions & 0 deletions src/content/docs/en/api/device-api/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "Device API Authentication"
description: "You need a bearer token to use the Device API."
slug: en/api/device-api/authentication
sidebar-position: 1
sidebar-label: Authentication
---

You need a [bearer token](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) to use the Device API. You can get this token in the Adjust dashboard by following the steps in this article.

## Before you begin

import Authentication from "@content/en/api/partials/_Authentication.mdx";

<Authentication />
70 changes: 70 additions & 0 deletions src/content/docs/en/api/device-api/forget.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "Forget device endpoint"
description: "Use the Adjust forget device endpoint to clear device history from Adjust and test multiple installs on the same device."
slug: en/api/device-api/forget
sidebar-position: 3
---

Use the Adjust forget device endpoint to clear device history from Adjust and test multiple installs on the same device.

<Callout type="seealso">
### Before you begin

You need **Admin** or **Editor** permissions to forget devices. If you have **Custom editor** permissions, you need to have edit rights for the app you are targeting. See [User permissions](https://help.adjust.com/en/article/users) for more information.

</Callout>

## Endpoint

```
https://api.adjust.com/device_service/api/v1/forget_device
```

### POST request

Clears the device's information from Adjust.

<ListTable>

- - Parameter
- Data type
- In
- Description
- - `app_token`\*
- String
- Data
- Your app's 12 digit identifier
- - `adid`\*
- String
- Data
- The device's Adjust ID

</ListTable>

## Example

```console
$ curl --location --request POST "https://api.adjust.com/device_service/api/v1/forget_device" \
--header "Authorization: Token token=ask43jskdp2tg2hg87" \
--data "adid=acf8534f2f052395e617a38730682ccc&app_token=gwzpeepw8uf8"
```

```console
Forgot device
```

<Accordion>
### Responses

<ListTable>

- - Response
- Message
- Description
- - 200
- Forgot device
- Success response

</ListTable>

</Accordion>
22 changes: 22 additions & 0 deletions src/content/docs/en/api/device-api/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: "Device API"
description: "Use the device API to view device information and clear device history from Adjust for testing purposes."
category-title: Device API
slug: en/api/device-api/index
---

Use the device API to view device information and clear device history from Adjust for testing purposes.

## How it works

1. Authenticate your calls

To use the Device API endpoints, you first need to get your Adjust API token. Follow the instructions in the [Authentication article](authentication.mdx) to find out how to use this token with the API.

2. Inspect device details

Use the [inspect device endpoint](inspect.mdx) to return details about a device and associated user activity.

3. Forget a device

Use the [forget device endpoint](forget.mdx) to clear device history from Adjust. This is useful if you need to clear device data to test multiple installs on the same device.
85 changes: 85 additions & 0 deletions src/content/docs/en/api/device-api/inspect.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: "Inspect device endpoint"
description: "Use the Inspect device endpoint to see information about a device. Provide your app ID and your device's advertising ID to return device and tracker information relating to the app."
slug: en/api/device-api/inspect
sidebar-position: 2
---

Use the Inspect device endpoint to see information about a device. Provide your app ID and your device's advertising ID to return device and tracker information relating to the app.

## Endpoint

```
https://api.adjust.com/device_service/api/v1/inspect_device
```

### GET request

Return device information as a JSON object.

<ListTable>

- - Parameter
- Data type
- In
- Description
- - `app_token`\*
- String
- Query
- Your app's 12 digit identifier
- - `advertising_id`\*
- String
- Query
- The device's unique advertising ID:
- `idfa` (iOS devices)
- `gps_adid` (Google advertising ID)
- `android_id` (Android ID)
- `fire_adid` (Amazon Fire ID)
- `win_adid` (Windows advertising ID)

</ListTable>

```json
{
"Adid": "string",
"AdvertisingId": "string",
"Tracker": "string",
"TrackerName": "string",
"ClickTime": "date-time",
"InstallTime": "date-time",
"LastSessionTime": "date-time",
"LastEventTimes": {
"string": "date-time",
"string": "date-time",
"string": "date-time",
"string": "date-time"
},
"State": "string"
}
```

## Example

```console
$ curl --location --request GET "https://api.adjust.com/device_service/api/v1/inspect_device?advertising_id=1234-5678-9012-3456&app_token=gwzpeepw8uf8" \
--header "Authorization: Bearer ask43jskdp2tg2hg87"
```

```json
{
"Adid": "acf8534f2f052395e617a38730682ccc",
"AdvertisingId": "1234-5678-9012-3456",
"Tracker": "abc123",
"TrackerName": "Organic",
"ClickTime": "0001-01-01T00:00:00Z",
"InstallTime": "2015-08-19T03:42:03Z",
"LastSessionTime": "2017-07-29T17:29:17Z",
"LastEventTimes": {
"a1a1a1": "2017-07-29T17:29:55Z",
"b2b2b2": "2017-07-29T17:29:21Z",
"c3c3c3": "2017-07-29T17:29:38Z",
"4d4d4d": "2017-07-29T17:29:58Z"
},
"State": "installed"
}
```
6 changes: 6 additions & 0 deletions src/content/docs/en/api/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "API documentation"
description: "Adjust API documentation"
category-title: API documentation
slug: en/api/index
---
26 changes: 26 additions & 0 deletions src/content/docs/en/api/partials/_Authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Find your Adjust API token

Before you can start making API calls, you first need to find your Adjust API token. You can find your Adjust API token in your Adjust dashboard.

<Callout type="important">
If you've configured SSO, your API tokens aren't available in the Adjust dashboard. Reach out to your Adjust representative or [email protected] for help with API tokens.
</Callout>

Your Adjust API token is located in your **profile**. To find it, follow these steps:

1. Select the settings icon (<Icon name="CogWheel" />) in the bottom left corner.
2. Select <GuiLabel>Account settings</GuiLabel>. Your account settings page opens.
3. Select the <GuiLabel>My profile</GuiLabel> tab.
4. Your <GuiLabel>API Token</GuiLabel> is shown with your <GuiLabel>User Details</GuiLabel>. Select the copy button (<Icon name="Copy" />) to copy the token to your system clipboard.

## Reset your Adjust API token

You can reset your Adjust API token at any time. Resetting your token invalidates the old token. This means that any requests made using the old token won't work. If you reset your Adjust API token, you need to make sure to update it wherever it's in use.

1. Select the settings icon (<Icon name="CogWheel" />) in the bottom left corner.
2. Select <GuiLabel>Account settings</GuiLabel>. Your account settings page opens.
3. Select the <GuiLabel>My Profile</GuiLabel> tab.
4. Your <GuiLabel>API Token</GuiLabel> is shown with your <GuiLabel>User details</GuiLabel>.
5. Select <GuiLabel>Reset API token</GuiLabel>. A popup modal appears.
6. Enter your account password in the modal and select <GuiLabel>Reset</GuiLabel> to reset your API token. The modal closes and a confirmation appears in the top right of the screen.
7. Select the copy button (<Icon name="Copy" />) next to the <GuiLabel>API Token</GuiLabel> to copy the token to your system clipboard.
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"baseUrl": ".",
"allowImportingTsExtensions": true,
"paths": {
"@components/*": ["src/components/*"]
"@components/*": ["src/components/*"],
"@content/*": ["src/content/docs/*"]
}
}
}