Jump to guide

Testing

Modify your request to predictably get responses you can test against.

The sandbox currently returns the same, single identity record given any valid phone number. We have plans for predictably modifying output so that you can have a full, thorough set of tests for your Cognito integration.

We are interested in hearing about what you are most interested in testing, so please get in touch if this is of interest to you.


Asynchronous responses

The /identity_searches endpoint supports the Prefer header with the respond-async option allowing you to force an asynchronous response when creating an identity search. The Prefer header can be used on both live and sandbox servers. We add a Preference-Applied: respond-async header to responses executed with this option.

Example request

POST /identity_searches HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Prefer: respond-async

{
  "data": {
    "type": "identity_search",
    "attributes": {
      "phone": {
        "number": "+16508007985"
      }
    },
    "relationships": {
      "profile": {
        "data": {
          "type": "profile",
          "id": "prf_3s527AoQo6Dw62"
        }
      }
    }
  }
}

Example response

HTTP/1.1 202 Accepted
Content-Type: application/vnd.api+json
Content-Location: /identity_searches/jobs/idsjob_2HLhnV3hMoaFFf
Preference-Applied: respond-async


{
  "data": {
    "type": "identity_search_job",
    "id": "idsjob_2HLhnV3hMoaFFf",
    "attributes": {
      "created_at": "2016-07-18T21:24:18Z",
      "updated_at": "2016-07-18T21:24:18Z",
      "status": "processing"
    },
    "relationships": {
      "identity_search": {
        "data": null
      }
    }
  }
}