Create person document
Use case
In this example, we will review how to add a document record for a person.
Use case data
API parameters with values
Adding a document record for a private person ID-3392
.
...persons/ID-3392/documents
Adding the person's passport details.
Sample API call
To create a person document, make the following API call.
Sample request
Below is an example request body of the API call for creating a person document.
{
"issuingCountry": "GB",
"number": "0124R5M1P5",
"documentTypeCode": "PASSPORT",
"expiryDate": "2025-01-03"
}
curl -L -g 'https://person-api.{{env}}.{{domain}}/api/v1/persons/ID-3392/documents' \
-H 'x-channel-code: SYSTEM' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDctMTdUMTg6Mzk6MTAiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2ODk2MTkxNTB9.cfzAzYCJ2lAWGHj_YxX9-vc21YS-ekBsZvOJx9C9Pqk' \
-H 'Content-Type: application/json' \
-d '{
"issuingCountry": "GB",
"number": "0124R5M1P5",
"documentTypeCode": "PASSPORT",
"expiryDate": "2025-01-03"
}'
Sample response
Below you will find an example response to the API call from above.
Response
{
"errors": null,
"validationErrors": null,
"data": {
"docuId": "ID-1024",
"personId": "ID-3392",
"issuingCountry": "GB",
"number": "0124R5M1P5",
"documentTypeCode": "PASSPORT",
"expiryDate": "2025-01-03",
"validityRange": {
"startTime": "2023-07-17T17:47:42.187928Z",
"endTime": null
}
}
}
Result
A new passport record ID-1024
was added for a private person.