Get attestation¶
GET/
User Activity Verification API · Attestations
Get an attestation by ID.
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)requiredUser ID.
titleobjectrequiredA text with optional translations.
Show child attributesHide child attributes
textstringrequiredThe 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.
Must be at most 100 characters long.
translationsobjectOptional key/value pairs of RFC 4646 language tag and translated version of the default text for that language.
questionobjectrequiredA text with optional translations.
Show child attributesHide child attributes
textstringrequiredMust be at most 500 characters long.
translationsobjectOptional key/value pairs of RFC 4646 language tag and translated version of the default text for that language.
optionsarray of objectList of answer options. If not specified, options 'yes' and 'no' are used.
Must contain at most 5 items.
Must contain at most 5 items.
An answer option for the attestation's question.
Show child attributesHide child attributes
keystringrequiredThe option key. This key is returned when the user selects an option.
Must match the pattern
Must match the pattern
^[\w,.\-/:]+$. Must be at most 36 characters long.valueobjectrequiredA text with optional translations.
Show child attributesHide child attributes
textstringrequiredThe 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.
Must be at most 100 characters long.
translationsobjectOptional key/value pairs of RFC 4646 language tag and translated version of the default text for that language.
actionstringAn action URI that Intercept X for Mobile opens when the user selects the option.
Must be at most 2048 characters long.
Must be at most 2048 characters long.
referencestringA reference set by the caller of the API and cited when requesting the attestation object.
Must match the pattern
Must match the pattern
^[\w,.\-/:]+$. Must be at most 256 characters long.idstring (uuid)requiredAttestation ID.
tenantobjectrequiredTenant this resource belong to.
Show child attributesHide child attributes
idstring (uuid)requirednamestringexpiresAtstring (date-time)requiredAttestation expiration timestamp. After expiration, the attestation is read-only.
statusstringrequiredAttestation 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:
Must be one of:
pending, expired, completed.selectedOptionstringThe 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.