Full server-to-server integration
This is an advanced alternative to the usual Gateway Front integration. Your application captures the document and the user's video; your backend sends them to the Gateway API and handles capture errors and retries. MobbScan Gateway Front is not used. Arrange the required tenant configuration and document/liveness methods with Mobbeel before integrating.
The sequence below applies to a tenant configured for an SDK or third-party integration. Confirm its capture settings with Mobbeel.
Responsibilities
| Your application and backend | MobbScan |
|---|---|
| Present your own capture flow, obtain document images and a video selfie, manage consent, quality feedback and retries | Scan the submitted document, run configured document and biometric validations |
Keep API credentials on the backend and associate every upload with the same scanId and onboarding token | Return scan responses, a process result and the available evidence |
| Decide only if your tenant is configured for integrator validation; receive a webhook if configured or query the result | Apply the configured decision workflow and send subscribed status notifications |
1. Authenticate and create a process
Exchange your API key and secret for a JWT access token as described in Authentication. The access token belongs on your backend; send it as Authorization: Bearer <ACCESS_TOKEN> when creating the process and later when reading results.
Create a process with a document supported for your tenant. In this example the document has two sides:
curl 'https://{GATEWAY-HOST}/onboarding/token' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"countryId":"ESP","docType":"IDCard"}'
{
"token": "9f1c2b7e-0a4d-4c55-8e3f-2b6d7c1a9e40",
"scanId": "123e4567-e89b-12d3-a456-426614174000"
}
The response field is token, not onboardingToken. Save both values: scanId identifies the process and token authenticates its capture requests in the onboarding-token header. For this integration the Gateway Front onboardingUrl is not used; the gateway only includes it for tenants configured for Gateway Front. countryId and docType in this example allow the gateway to resolve the document type; confirm valid values for your tenant. See Create onboarding process.
2. Start the scan
curl 'https://{GATEWAY-HOST}/mobbscan-agent/scan/start' \
--header 'onboarding-token: YOUR_ONBOARDING_TOKEN' \
--form 'scanId=123e4567-e89b-12d3-a456-426614174000' \
--form 'clientVersion=integrator-web/1.0.0'
clientVersion is required by this gateway endpoint; use it to identify the client you implement, not Gateway Front. The gateway derives the document type and operation mode from the onboarding when you do not override them. Check the response code before continuing. See Start scan process.
3. Scan the document
Capture the images in your application and send them from your backend. For a two-sided identity card, submit both front and back:
curl 'https://{GATEWAY-HOST}/mobbscan-agent/scan' \
--header 'onboarding-token: YOUR_ONBOARDING_TOKEN' \
--form 'scanId=123e4567-e89b-12d3-a456-426614174000' \
--form 'front=@/path/to/front.jpg' \
--form 'back=@/path/to/back.jpg'
For the combined /scan endpoint, back is required and front is optional; a passport normally uses its data page as back. Check the returned code, document and configured validations before proceeding. Your application is responsible for recapture when necessary. See Scan document for the response and optional parameters. Tenant-specific capture security may require additional headers agreed with Mobbeel.
4. Verify the user's identity
With a document already scanned, submit the video using the liveness method enabled for your tenant. Here 1 means passive liveness:
curl 'https://{GATEWAY-HOST}/mobbscan-agent/identityVerification?scanId=123e4567-e89b-12d3-a456-426614174000&livenessMethod=1' \
--header 'onboarding-token: YOUR_ONBOARDING_TOKEN' \
--form 'video=@/path/to/selfie.mp4'
The upload accepts MP4. When you download the recording through the Evidence API, it is returned as video/webm; the upload and download formats differ.
Consult Identity verification for its response, scores and validation fields. An HTTP 200 only confirms that the request was processed: examine its code and validations, then query the process result before making a final decision. Do not send another video attempt for the same process while a previous request is still running.
5. Read the result and evidence
If configured, webhooks notify your backend of subscribed status changes. You can also query Check process result with scanId as verificationId; when code is OK, possible public results include PENDING, PENDING_VALIDATION, VERIFIED, NOT_VERIFIED and CANCELLED. An unknown ID can instead yield HTTP 200 with code: ERROR.
Only if your tenant is configured for integrator-side decisions, handle PENDING_VALIDATION by accepting, rejecting or sending the process for review. These calls use the access token, not the onboarding token. Finally, use Get process information and Evidence to retrieve the extracted data, images, video or available report.
Integration checks
- Keep the API key, secret and access token on your backend. Use the onboarding token only for capture calls belonging to its
scanId. - Agree document types, liveness method, supported file formats and any capture-security headers with Mobbeel for your tenant; do not assume the settings of another integration apply.
- Treat business errors in JSON responses separately from HTTP errors; see Error responses. Wait for a request to finish before retrying a capture; if its outcome is uncertain, query the process before starting another attempt.
- If you use webhooks, process them idempotently and check the latest result. Delivery and the status changes you receive depend on your tenant configuration.