> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/platform/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/api-and-integrations-classic/other-integrations-classic/getsid-api-classic.md).

# GetSID API (classic)

## Overview <a href="#getsidapi-classic-overview" id="getsidapi-classic-overview"></a>

The *GetSID API* lets you retrieve the Security Identifier (SID) of end users.

Because [triggering a campaign via the Engage API](/platform/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/api-and-integrations-classic/other-integrations-classic/triggering-remote-actions-via-their-api-classic.md) requires the SID of the targeted users as a parameter, the GetSID API is specially useful for automatically triggering campaigns from environments where the SID of users is not readily available.

## Calling the GetSID API <a href="#getsidapi-classic-callingthegetsidapi" id="getsidapi-classic-callingthegetsidapi"></a>

The Portal exposes the Engage API as a REST API under the URL:

`https://[portal.company.com]/api/inventory/v1/getusersid`

In the URL, substitute `[portal.company.com]` for the external DNS name of your Portal.

To get the SID of an end user, submit a POST request to the URL of the API (note that GET requests are not supported, returning a 404 error) with a JSON payload encoded in UTF-8 that contains two parameters:

| Name          | Description                                                                                                                                                                                                                    |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `fieldName`   | <p>Name of the field that serves to retrieve the user. Look for users either by:</p><ul><li><strong>name</strong>: User logon name.</li><li><strong>dn</strong>: Distinguished name of the user in Active Directory.</li></ul> |
| `fieldValues` | List of values to search on the specified field (currently limited to 1 element).                                                                                                                                              |

Example of the JSON payload of a request to the API of Engage:

```
{
 "fieldName": "name",
 "fieldValues" : ["foobarUser@example.com"]
}
```

### HTTP headers <a href="#getsidapi-classic-httpheaders" id="getsidapi-classic-httpheaders"></a>

Send your POST request to the GetSID API with the following HTTP headers to specify JSON content and basic authentication:

`Content-type: application/json`

`Authorization: Basic [base-64(user:password)]`

Replace `[base-64(user:password)]` with the credentials (in base-64 encoding) of a Nexthink user who has the right to access the API for triggering campaigns.

### Error conditions <a href="#getsidapi-classic-errorconditions" id="getsidapi-classic-errorconditions"></a>

In response to a request, the Portal may send one of the following answers if something goes wrong:

| Error type       | HTTP code                 | Cause                                                                                                                                                                                       |
| ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Access Denied    | Unauthorized 401          | <ul><li>Authentication error</li></ul>                                                                                                                                                      |
| Validation error | Bad request 400           | <ul><li>Invalid JSON</li><li>Invalid encoding</li><li>Invalid Content-type</li><li>Missing or invalid <code>fieldName</code></li><li>Missing or too many <code>fieldValues</code></li></ul> |
| Unknown error    | Internal server error 500 | <ul><li>Undefined internal error</li></ul>                                                                                                                                                  |

***

RELATED TASK

* [Triggering campaigns via their API](/platform/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/api-and-integrations-classic/other-integrations-classic/triggering-remote-actions-via-their-api-classic.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexthink.com/platform/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/api-and-integrations-classic/other-integrations-classic/getsid-api-classic.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
