Quick setup
Prerequisites
- Install Docker
- Sign up on our DevHub and contact sales
via sales@microblink.com. They’re going to provide you with a
LICENSEEand aLICENSE_KEYwhich you’ll need in the next steps.
Step 1: Running the API with Docker
You can run it using Docker Compose. Save the following docker-compose.yaml file:
docker-compose.yaml
version: '3'
services:
api:
image: microblink/api:latest
environment:
- LICENSEE=your-licensee
- LICENSE_KEY=your-key
ports:
- "8080:8080"
volumes:
# Please keep the following two lines in your docker compose and help us with better ping statistics. Only relevant for licenses with ping.
- /etc/machine-id:/etc/machine-id
- /var/lib/dbus/machine-id:/var/lib/dbus/machine-id
In the file, make sure to set the LICENSEE and LICENSE_KEY values.
Then, run:
docker-compose up
Alternatively, you can run the Microblink API using Docker with the following command:
docker run -p 8080:8080
-e "LICENSEE=xxxx"
-e "LICENSE_KEY=xxxx"
-v /etc/machine-id:/etc/machine-id
-v /var/lib/dbus/machine-id:/var/lib/dbus/machine-id
microblink/api
Step 2: Testing the API Setup
Once the API is running, you can verify the setup by sending a test request using curl:
curl --location 'http://localhost:8080/blinkid-multi-side'
--header 'Content-Type: application/json'
--data '{
"imageFront": {
"imageBase64": null,
"imageUrl": "https://storage.googleapis.com/microblink-data-public/microblink-api/test-set/blinkid/CRO_ID_FRONT/CRO_ID_FRONT_sample1_with_disclaimer.jpg"
},
"imageBack": {
"imageBase64": null,
"imageUrl": "https://storage.googleapis.com/microblink-data-public/microblink-api/test-set/blinkid/CRO_ID_BACK/CRO_ID_BACK_sample_with_disclaimer.jpg"
}
}'
If the setup is correct, you should receive a JSON response with the document recognition results.
If you want to filter out the result a bit, you can use jq:
curl --location 'http://localhost:8080/blinkid-multi-side' \
--header 'Content-Type: application/json' \
--data '{
"imageFront": {
"imageBase64": null,
"imageUrl": "https://storage.googleapis.com/microblink-data-public/microblink-api/test-set/blinkid/CRO_ID_FRONT/CRO_ID_FRONT_sample1_with_disclaimer.jpg"
},
"imageBack": {
"imageBase64": null,
"imageUrl": "https://storage.googleapis.com/microblink-data-public/microblink-api/test-set/blinkid/CRO_ID_BACK/CRO_ID_BACK_sample_with_disclaimer.jpg"
}
}' | jq '.data.firstName, .data.lastName, .data.processingStatus'
If you want to see more examples, feel free to use our Postman collection.