Skip to main content

Get User

Endpoint: https://api.adcyma.com/v1/api/user
Method: GET
Description: Retrieves the cached details of a single user by userPrincipalName (UPN). Data comes from Adcyma's local cache of your Entra ID directory, so it's fast and doesn't consume Microsoft Graph quota.

Request Headers:

  • X-Company-ID: Your tenant identifier.
  • X-Api-User: API username.
  • X-Api-Key: API secret key.

Query Parameters:

  • userPrincipalName: The UPN of the user to look up. Required.

Example Request:

GET /v1/api/user?userPrincipalName=john.doe@example.com HTTP/1.1
Host: api.adcyma.com
X-Company-ID: AcmeAB-1f2c8a90
X-Api-User: integrations-bot
X-Api-Key: your-secret-key

Response:

On success, returns the cached user object inside data.user. The shape mirrors what Microsoft Graph stores. The example below shows the most common fields; additional Graph properties may also be present.

Success Response (200 OK):

{
"data": {
"user": {
"id": "8a1b9d2e-9b3a-4f0e-a8c1-7b9e9c2d4a11",
"userPrincipalName": "john.doe@example.com",
"givenName": "John",
"surname": "Doe",
"displayName": "John Doe",
"jobTitle": "Software Engineer",
"department": "Engineering",
"officeLocation": "Stockholm",
"city": "Stockholm",
"country": "SE",
"accountEnabled": true,
"manager": {
"id": "f2a1c4d8-1e7b-4d33-b0a1-2c8d5f9e6b22",
"displayName": "Jane Smith"
}
}
}
}

Error Response (400 Bad Request):

{
"error": {
"code": "BAD_REQUEST",
"message": "Missing required query parameter: userPrincipalName"
}
}

Error Response (401 Unauthorized):

{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API credentials"
}
}

Error Response (404 Not Found):

{
"error": {
"code": "NOT_FOUND",
"message": "User not found"
}
}

Error Response (429 Too Many Requests):

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests"
}
}