Law Enforcement - Capture API

Authentication#

Simple Login#

The application supports basic HTTP authentication, as specified by RFC 7617, whereby an authorization token is received in response to a successful login request. This request contains a header field in the form of Authorization: Basic <credentials>, where credentials is the Base64 encoding of ID and password joined by a single colon (:).

POST {base_url}/v1/login

Use this method to log into the application and receive an Authorization Token. To use the token in subsequent requests, simply set the header's Authorization value to Bearer [access_token], where access_token is the access token received upon a successful login request.

Return Type

String

Example Request

curl --location --request POST 'https://le2.imageware.io/v1/login' \
--header 'Authorization: Basic VEVTVDI4242VDJURVNUMg=='

Example Response

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08"
}

Responses

200 OK - Returned access token

401 Unauthorized

Creating a New Booking#

The process of enrolling a new identity is broken up into multiple parts:

  • First obtain a new, unique Booking Number. This will be used for all subsequent calls. Note that at this point, the enrollment does not exist yet, only a Booking Number has been reserved. If the enrollment is aborted the database will remain unchanged.
  • Booking data can be upserted in two ways: either by calling the GraphQL mutation enrollBookingBiographics or enrollBookingImageMetadata. On the first successful call to one of these, the Booking is considered to be created.
  • enrollBookingImageMetadata serves to add to update the Booking with one or more images that have previously been uploaded to the image bank using POST /v1/images. Note that if images uploaded here fail to be mapped to Bookings, they will eventually be considered orphaned and purged from the database.
  • enrollBookingBiographics serves to add or update biographic information to the Booking.
  • For efficiency, both mutations enrollBookingImageMetadata and enrollBookingBiographics can be called simultaneously.

Entire Bookings can also be imported directly by providing EBTS files to the /v1/booking/import endpoint.

Getting a new Booking Number#

GET {base_url}/v1/booking/number/:machineCode

Creates a new, unique Booking Number for subsequent use as the primary enrollment identifier throughout the capture process. The machineCode is a string prefix to be used when generating the Booking Number.

Return Type

String

Example Request

curl --location --request GET 'https://le2.imageware.io/v1/booking/number/A11'
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'

Example Response

{
"bookingNum": "A1101557"
}

Responses

200 OK - Success

400 Bad Request - Invalid Machine Code

401 Unauthorized - Invalid access token provided in request's header

Inserting or Updating Biographic Data#

POST {base_url}/graphql

Inserts or updates biographic data in the database using the GraphQL mutation enrollBookingBiographics. Note that the biographic fields that can be provided depend on the Agency Config of the deployment.

Return Type

String

Example Request

curl --location -g --request POST 'https://le2.imageware.io/v1/graphql' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'\
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { enrollBookingBiographics(input: { bookingNum: \"A1101542\", biographics:{ Sex: \"M\", DateOfBirth: \"2000-03-09\", SubjectName: { Last: \"WHITE\", First: \"JOHN\", Middle: \"LUCAS\", Suffix: \"JR\" }, DateOfArrest: \"2021-03-09\" } }) { enrollmentStatus } }"'

Example Response

{
"enrollBookingBiographics":{
"enrollmentStatus":"WIP"
}
}

Responses

200 OK - Success

400 Bad Request - Unsupported content type

401 Unauthorized - Invalid access token provided in request's header

Uploading Image Data#

POST {base_url}/v1/images/:imageId POST {base_url}/v1/images

Uploads an image to the database. If the client provides a UUID then it will either create a new record or update the existing one if UUID exists. If the client does not provide a UUID, the server will create a new UUID. Up to two images can be uploaded at the same time (in multipart/form-data) whereby the second image is assumed to be the compressed version (WSQ) of the first image. Note that this should only be used for fingerprint and palm images.

The server returns either a new UUID or the client-provided UUID back to the caller.

Return Type

String

Example Request

curl --location --request POST 'https://le2.imageware.io/v1/images/9BCB3FCD-F231-454F-ABC1-5FB6519C1F87'
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'
--header 'Content-Type: image/jpeg' \
--data-binary '@Sample.jpg'

Example Response

{
"imageId": "9BCB3FCD-F231-454F-ABC1-5FB6519C1F87"
"contentType": "image/jpeg"
"createdAt": "2022-05-10T00:07:05.213Z",
"updatedAt": "2022-05-10T00:07:05.213Z"}

Example Request

curl --location -g --request POST '{{base_url}}/v1/images' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'
--header 'Content-Type: multipart/form-data' \
--form 'images=@"Fingerprint.png"' \
--form 'images=@"Fingerprint.wsq"'

Example Response

{
"imageId": "f2a1621c-ecd0-4951-8da0-4319270a60eb",
"contentType": "image/jpeg",
"createdAt": "2022-05-11T00:07:00.687Z",
"updatedAt": "2022-05-11T00:07:00.687Z"
}

Responses

200 OK - Success

400 Bad Request - Unsupported content type

401 Unauthorized - Invalid access token provided in request's header

Getting an Image#

GET {base_url}/v1/images/:imageId

Gets an image from the database.

Return Type

Binary data

Example Request

curl --location -g --request GET 'https://le2.imageware.io/v1/images/9BCB3FCD-F231-454F-ABC1-5FB6519C1F87' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'
--header 'Content-Type: text/plain' \
--data-binary '@'

Responses

200 OK - Success

400 Bad Request - Unsupported content type

401 Unauthorized - Invalid access token provided in request's header

404 Not found - The provided UUID does not represent an existing image

Inserting or Updating Image Metadata#

POST {base_url}/graphql

Inserts or updates image metadata in the database using the mutation enrollBookingImageMetadata

Return Type

String

Example Request

curl --location -g --request POST 'https://le2.imageware.io/v1/graphql' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'\
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { enrollBookingImageMetadata(input: { bookingNum: \"A1101542\", imageMetadata: [{ imageId: \"328ebfc3-4081-496c-9c19-8be609ffa895\", bioType: \"FaceFront\", capturedAt: \"2021-05-14T22:38:37.000Z\" metadata: { someField: \"someVal\", anotherField: \"anotherVal\" } } ] }) { enrollmentStatus } }"'

Responses

200 OK - Success

400 Bad Request - Unsupported content type

401 Unauthorized - Invalid access token provided in request's header

404 Not found

Simultaneous Biographic/Image Insert or Update#

POST {base_url}/graphql

Inserts or updates both biographic and image metadata in the database using both mutations enrollBookingBiographics and enrollBookingImageMetadata.

Return Type

String

Example Request

curl --location -g --request POST 'https://le2.imageware.io/v1/graphql' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'\
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { enrollBookingBiographics(input: { bookingNum: \"A1101542\", biographics:{ Sex: \"M\", DateOfBirth: \"2000-03-09\", SubjectName: { Last: \"WHITE\", First: \"JOHN\", Middle: \"LUCAS\", Suffix: \"JR\" }, DateOfArrest: \"2021-03-09\" } }) { enrollmentStatus }, enrollBookingImageMetadata(input: { bookingNum: \"A1101542\", imageMetadata: [{ imageId: \"328ebfc3-4081-496c-9c19-8be609ffa895\", bioType: \"FaceFront\", capturedAt: \"2021-05-14T22:38:37.000Z\" metadata: { someField: \"someVal\", anotherField: \"anotherVal\" } } ] }) { enrollmentStatus } }"'

Responses

200 OK - Success

400 Bad Request - Unsupported content type

401 Unauthorized - Invalid access token provided in request's header

404 Not found

Importing a New Booking#

POST {base_url}/v1/booking/import

Uploads an EBTS file and enrolls its contents into the database, as a new Booking. Note that {agencyConfig.jfd.bookingNumberFieldName} specifies the name of the JDF field that identifies the Booking Number.

Example Request

curl --location --request POST 'https://le2.imageware.io/v1/booking/import'
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTIyMDU4NDQsImV4cCI6MTY1MjIwNjc0NCwic3ViIjoiNTAzIn0.ZzEs36qqo7eb4Q0qFnveE-D90JKmdfJqNkNYljwjO08'
--form 'files=@"Sample.ebts"'

Example Response

OK: Successfully enrolled NIST package with BookingNumber: A1101542

Responses

201 Created - Successfully enrolled

202 Accepted - Booking Number already enrolled. In this case the database remains unchanged apart from the generated auditing event.

400 Bad Request - Defects observed in the EBTS file

401 Unauthorized - Invalid access token provided in request's header