> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/n/nexthink.md).

# Nexthink

Nexthink is a digital employee experience platform. OctoXLabs runs a saved NQL query through the Nexthink API and adds each row to the device inventory.

## Use cases

* List the devices returned by your NQL query.

```
Adapters = nexthink
```

## Before you begin

### Network

| Source              | Destination                                | Port | Protocol |
| ------------------- | ------------------------------------------ | ---- | -------- |
| OctoXLabs connector | `<instance>-login.<region>.nexthink.cloud` | 443  | HTTPS    |
| OctoXLabs connector | `<instance>.api.<region>.nexthink.cloud`   | 443  | HTTPS    |

### Required permissions

| Scope or role                     | Permission | Needed for                  |
| --------------------------------- | ---------- | --------------------------- |
| NQL API (OAuth client permission) | Execute    | Running the saved NQL query |

The connector requests the scope `service:integration`. Regions: `us` United States, `eu` European Union, `pac` Asia-Pacific, `meta` Middle East, Turkey and Africa.

## Create credentials in Nexthink

{% stepper %}
{% step %}

### Open API credentials

Log in to the Nexthink web interface and go to Administration > API credentials.
{% endstep %}

{% step %}

### Create the client

Select New OAuth client credentials and give it a name. Under Permissions, enable NQL API.
{% endstep %}

{% step %}

### Save and copy

Select Save and generate credentials. Copy the Client ID and Secret key at once. They are shown only once.
{% endstep %}

{% step %}

### Create the NQL query

In the Nexthink portal, create and save an NQL query that returns your devices. It must include a `name` column. The query ID has the form `#query_name` and holds only lowercase letters, numbers and underscores. See the Nexthink NQL documentation (<https://docs.nexthink.com/api/nql#preparing-queries>).
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                       | Required | Type    | Default | Description                                                                            |
| ------------------------------- | -------- | ------- | ------- | -------------------------------------------------------------------------------------- |
| Instance (`instance`)           | Yes      | String  |         | First part of your Nexthink URL. For `mycompany.eu.nexthink.cloud`, enter `mycompany`. |
| Region (`region`)               | No       | String  | eu      | One of `us`, `eu`, `pac`, `meta`.                                                      |
| Client ID (`client_id`)         | Yes      | String  |         | OAuth2 client ID.                                                                      |
| Client Secret (`client_secret`) | Yes      | String  |         | OAuth2 client secret.                                                                  |
| Query ID (`query_id`)           | Yes      | String  |         | ID of the saved NQL query, for example `#device_inventory`.                            |
| Use V2 API (`use_v2`)           | No       | Boolean | False   | Use the V2 NQL endpoint instead of V1.                                                 |
| Proxy (`proxy`)                 | No       | String  |         | Proxy host and port, sent as an `http://` proxy URL.                                   |
| Timeout (`timeout`)             | No       | Integer | 30      | Seconds to wait for API responses.                                                     |

## Troubleshooting

| Error message | Cause | Fix                                    |
| ------------- | ----- | -------------------------------------- |
| Not verified  |       | No adapter-specific error text in code |

## Change history

{% hint style="info" %}
Available starting from version 6.3.0.
{% endhint %}
