Skip to content

Get attestation

GET/attestations/{attestationId}

User Activity Verification API · Attestations

Get an attestation by ID.

Required permissionuav.attestation:read

Parameters

Name In Type Required Description
attestationId path string (uuid) Yes Attestation ID.
X-Tenant-ID header string (uuid) Yes Tenant ID.
fields query array of string No The fields to return in a partial response.

Request samples

curl -X GET "https://api-<data-region>.central.sophos.com/user-activity-verification/v1/attestations/<attestationId>" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"

import requests

response = requests.get(
    "https://api-<data-region>.central.sophos.com/user-activity-verification/v1/attestations/<attestationId>",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Tenant-ID": "<tenant-id>",
    },
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api-<data-region>.central.sophos.com/user-activity-verification/v1/attestations/<attestationId>" -Headers $headers

package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/user-activity-verification/v1/attestations/<attestationId>", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Tenant-ID", "<tenant-id>")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

const response = await fetch("https://api-<data-region>.central.sophos.com/user-activity-verification/v1/attestations/<attestationId>", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Attestation object for given attestation ID.

Response fields

userIdstring (uuid)required
User ID.
titleobjectrequired
A text with optional translations.
Show child attributesHide child attributes
textstringrequired
The default (i.e. English) text. This text is displayed when no translations are provided or the translations don't match the device language. The limitation of the text length applies to translations as well.
Must be at most 100 characters long.
translationsobject
Optional key/value pairs of RFC 4646 language tag and translated version of the default text for that language.
questionobjectrequired
A text with optional translations.
Show child attributesHide child attributes
textstringrequired
Must be at most 500 characters long.
translationsobject
Optional key/value pairs of RFC 4646 language tag and translated version of the default text for that language.
optionsarray of object
List of answer options. If not specified, options 'yes' and 'no' are used.
Must contain at most 5 items.
An answer option for the attestation's question.
Show child attributesHide child attributes
keystringrequired
The option key. This key is returned when the user selects an option.
Must match the pattern ^[\w,.\-/:]+$. Must be at most 36 characters long.
valueobjectrequired
A text with optional translations.
Show child attributesHide child attributes
textstringrequired
The default (i.e. English) text. This text is displayed when no translations are provided or the translations don't match the device language. The limitation of the text length applies to translations as well.
Must be at most 100 characters long.
translationsobject
Optional key/value pairs of RFC 4646 language tag and translated version of the default text for that language.
actionstring
An action URI that Intercept X for Mobile opens when the user selects the option.
Must be at most 2048 characters long.
referencestring
A reference set by the caller of the API and cited when requesting the attestation object.
Must match the pattern ^[\w,.\-/:]+$. Must be at most 256 characters long.
idstring (uuid)required
Attestation ID.
tenantobjectrequired
Tenant this resource belong to.
Show child attributesHide child attributes
idstring (uuid)required
namestring
expiresAtstring (date-time)required
Attestation expiration timestamp. After expiration, the attestation is read-only.
statusstringrequired
Attestation status. If the user selected an answer option, the status is 'completed' and the key of the selected answer option is available in 'selectedOption'. If the user didn't select an answer option before the attestation expired, the status is 'expired'. If the user didn't select an answer option yet and the attestation hasn't expired, the attestation is in 'pending' status.
Must be one of: pending, expired, completed.
selectedOptionstring
The key of the answer option the user selected (when status is 'completed'). 'selectedOption' is 'yes' or 'no' for attestations without answer options.

Errors

Status Meaning
404 Can't find attestation.
429 Too many requests. See Retry-After header.
500 Internal server error.

All error responses share the same shape — see the error response object.

Response examples

200

{
  "userId": "57e7f67f-6c1a-4580-a031-65f38a229732",
  "title": {
    "text": "Security Question",
    "translations": {
      "de": "Sicherheitsfrage"
    }
  },
  "question": {
    "text": "When was the last time you signed in to your account?",
    "translations": {
      "de": "Wann haben Sie sich das letzte Mal an Ihrem Benutzerkonto angemeldet?"
    }
  },
  "options": [
    {
      "key": "today",
      "value": {
        "text": "Today",
        "translations": {
          "de": "Heute"
        }
      }
    },
    {
      "key": "yesterday",
      "value": {
        "text": "Yesterday",
        "translations": {
          "de": "Gestern"
        }
      }
    },
    {
      "key": "lastWeek",
      "value": {
        "text": "One week ago",
        "translations": {
          "de": "Vor einer Woche"
        }
      }
    },
    {
      "key": "unsure",
      "value": {
        "text": "I don't remember",
        "translations": {
          "de": "Ich wei\u00df es nicht mehr"
        }
      }
    }
  ],
  "id": "e0f14a18-a5ee-4d86-b0c2-cf0a2849ed78",
  "tenant": {
    "id": "d46d9df1-ee5a-44cc-8bf5-252fcc3c16f0"
  },
  "expiresAt": "2021-11-05T09:39:44.638",
  "status": "pending"
}

See the guide for a narrative walkthrough of this API.