Skip to main content

SDK reference

This page describes parameters, captures, upload responses and retry conditions. Platform-specific signatures are documented in the React Native, Capacitor and native guides.

Configuration​

ParameterTypeCapacitorReact NativeDescription
apiKeystringrequiredrequiredSDK API key provided for your company.
baseUrlstringrequiredoptionalURL ending in /certificall/. React Native default: production.
appVersionstringrequiredoptionalYour application's version. React Native default: 1.0.0.

With Capacitor, call initialize(options). With React Native, call configure(options). Wait for the promise to resolve before any capture or upload. Set baseUrl explicitly to control which environment is used.

takePhoto()​

const photo = await CertificallTrust.takePhoto({
reportToken: 'JOB-2026-001',
metadata: { site: 'Paris', zone: 'A1' },
});

The options object is optional. The method checks the device, opens its camera and returns a local capture CapturedPhoto. No case is created before upload.

ParameterTypeRequiredDescription
reportTokenstringnoYour business reference, returned on upload and in webhook reportId. Limit it to 255 characters.
metadataRecord<string, string>noKey-value pairs attached to the case created on upload.

For metadata, use at most 20 keys, each up to 40 characters, with text values up to 500 characters. Keys cannot contain [ or ]. Convert numbers and booleans to text ("42", "true").

Invalid metadata are discarded during upload and reported as METADATA_DROPPED; they do not, on their own, prevent certification. See also Case metadata.

CapturedPhoto​

FieldTypeDescription
captureIdstringCapture UUID, used to recognize retries.
capturedAtstringCapture time, ISO 8601 UTC.
sessionIdstringSession identifier generated by the SDK. Keep it without rebuilding it.
imageCapturedImageBase64 JPEG image, format and dimensions.
exifobject or nullAvailable EXIF data.
signalsCaptureSignalsTrust data frozen at capture time.
debugBuildbooleanIndicates a capture from a development build.
reportTokenstring or nullBusiness reference provided at capture time.
metadataobject or nullMetadata provided at capture time.
targetnullReserved field; keep the value returned by the SDK.
proofnullReserved field; keep the value returned by the SDK.

Image​

FieldTypeDescription
image.base64stringBase64 JPEG content, required for upload.
image.formatstringjpeg.
image.widthnumberWidth in pixels.
image.heightnumberHeight in pixels.

Trust data​

The SDK automatically collects these data from configuration onward, then attaches them to the capture. You do not need to collect or add them yourself.

FieldContent
signals.historyPositionsPositions: timestamp, lat, long, accuracy, altitude, speed, heading.
signals.historyMotionsMotion: timestamp, acceleration (x, y, z) and rotation (alpha, beta, gamma).
signals.devicemanufacturer, model, name, platform, os, osVersion, appVersion, isVirtual, batteryLevel, isCharging.
signals.networkconnectionType, wifiIp, carrierIp. Addresses can be null.

History timestamps are in milliseconds. Coordinates are in degrees, accuracy and altitude in metres, speed in metres per second and heading in degrees. Acceleration is in m/s², including gravity; rotation is in degrees per second. Battery is a fraction between 0 and 1 (0.8 for 80%), or null if unknown.

These data remain those of capture time, even with a deferred upload. Arrays can be empty when no signals could be collected; review the warnings in the upload response.

sendPhoto()​

Pass the complete capture returned by takePhoto(), or restored from your storage:

// React Native
const sent = await CertificallTrust.sendPhoto(photo);
// Capacitor
const sent = await CertificallTrust.sendPhoto({ photo });

Certificall creates the case, adds the photo, closes it and produces the PDF certificate. The SentPhoto response is returned after this workflow. Missing trust data are reported in warnings.

Call sendPhoto() right after the capture, as soon as the network allows. A photo uploaded more than 10 minutes after it was taken carries the "no internet connection" banner on its certificate.

SentPhoto​

FieldTypeDescription
captureIdstringIdentifier of the uploaded capture.
itemIdstringCertificall photo identifier.
caseIdstringIdentifier of the created case.
reportTokenstring (optional)Business reference echoed back.
imageUrlstringImage URL.
pdfUrlstringPDF certificate URL.
geoloc{ lat: number, lng: number } (optional)Coordinates used for the photo. With NO_POSITION, do not use them as a real location.
createdAtstringServer-side creation time, ISO 8601.
warnings{ code: string, message: string }[]Missing, discarded or replaced data; empty array if there are no warnings.

Additional fields returned by Certificall are passed through by the SDK. Tolerate additional fields and warning codes.

Certificate and analysis

The response does not contain a score. The case webhook delivers the case when it closes; the analysis result webhook subsequently delivers the trust result. You can link them to your system with reportToken, returned as reportId.

Storage and retries​

The SDK does not maintain a persistent queue or schedule automatic retries. Your application handles storage and upload scheduling.

  1. Save the complete object returned by takePhoto(), using JSON.stringify(photo) for JavaScript bridges. Include image.base64.
  2. Read it back with JSON.parse(serializedPhoto) when upload becomes possible.
  3. Call sendPhoto() with the restored capture, without changing its identifiers or signals.
  4. Remove the capture from your queue after a successful response, keeping any identifiers and links your application needs.

If connectivity is interrupted or the application closes before receiving the response, send the same capture again. If it has already been certified, you receive the same case and photo identifiers and the same certificate link. A new takePhoto() call carries a different captureId and creates another case.

SituationAction
NETWORK_UNAVAILABLEKeep the capture and retry when Certificall is reachable.
SERVER_REJECTED, reason CAPTURE_IN_PROGRESS, HTTP 409The same capture is being certified. Retry after a few minutes.
SERVER_REJECTED, reason CAPTURE_NOT_CERTIFIED, HTTP 503The photo was received but certification failed. Keep it and retry later.
HTTP 429Space out uploads and retry after the rate-limiting window.
Other server error 5xxKeep the capture and retry with a delay.
Invalid key or blocked companyCorrect the situation before resuming uploads.

If an initial attempt remains unfinished for more than 10 minutes, a retry can start again in a new case. Returning the same case applies to an already-certified capture; an unfinished case is not reused after that interval.

Preserve the capture

Keep the JSON produced by the SDK as-is. Do not replace signals with data from upload time or remove captureId: it allows Certificall to recognize a retry.

Warnings​

A warning is not an upload failure: a successful response with warnings means the photo was saved and certified. Missing data can lower the trust score. Your application can notify the user or offer a new capture according to your business needs.

CodeMeaning
NO_POSITIONNo usable position; the photo has no location.
NO_MOTIONNo motion collected.
NO_DEVICEDevice model missing or unreadable.
NO_BATTERYBattery level unknown.
NO_IPNo IP address provided.
CAPTURE_UNREADABLECapture description missing or unreadable; signals cannot be used.
CAPTURE_ID_GENERATEDCapture identifier missing or invalid, replaced by the server. Retrying this upload does not benefit from recognition by the original identifier.
CAPTURED_AT_MISSINGCapture time missing or invalid; reception time is used.
SIGNALS_DROPPEDSome unreadable positions or motion entries were discarded.
SIGNALS_TRUNCATEDMore than 200 positions or motion entries sent; the 200 most recent in each history are kept.
METADATA_DROPPEDInvalid metadata; the case is created without those metadata.

The message values are explanations in English. Use codes to drive your logic and translations.

Errors​

Capture and upload codes​

CodeOperationAction
NOT_INITIALIZEDCapture or uploadConfigure the SDK and wait for initialization to finish.
DEVICE_NOT_TRUSTEDCaptureRead reasons and explain the device refusal to the user.
CAPTURE_CANCELLEDCaptureThe user left the camera. Nothing is uploaded.
NO_CAMERACaptureNo camera available; the photo library is not offered instead.
CAPTURE_FAILEDCaptureThe camera did not return a usable photo; capture again.
INVALID_PHOTOUpload through a bridge or iOS restorationPass the complete object returned by takePhoto().
NETWORK_UNAVAILABLEUploadKeep the capture for a retry.
SERVER_REJECTEDUploadRead the HTTP status and server reason, then apply the corresponding strategy.

Configuration or permission errors can also originate from your platform's APIs. Check permissions and the presence of configuration parameters.

Read additional information​

PlatformCodeDevice refusal reasonsServer status and reason
Capacitorerror.codeerror.data.reasonserror.data.status, error.data.reason
React Nativeerror.codeerror.userInfo.reasonserror.userInfo.status, error.userInfo.reason
SwiftCertificallSDKError.code(of: error)CertificallSDKError.reasonshttpStatus, serverCode on the typed error
KotlinCertificallError.codeOf(error)DeviceNotTrustedException.reasonsSendPhotoException.httpStatus, SendPhotoException.serverCode

Server rejections​

HTTP refusals use SERVER_REJECTED. The reason can be absent; do not rely only on the message text.

HTTP statusReason when providedAction
400INVALID_CAPTURE if the image is missingCheck that the capture and its image are complete.
401Missing, invalid, inactive or expired keyCheck the environment key and its renewal.
403DEBUG_BUILD_REJECTEDTake a new photo with a distribution build for production.
409CAPTURE_IN_PROGRESSRetry the same capture later.
409CAPTURE_ID_TAKENThe identifier is already used by another capture; take a new photo.
423Blocked companyHave the company's access restored before resuming uploads.
429Request limit reachedSpace out uploads.
503CAPTURE_NOT_CERTIFIEDKeep the capture and retry later.

A 2xx HTTP response without a case result can also produce SERVER_REJECTED. Check baseUrl, especially its /certificall/ suffix, and keep the capture until upload succeeds.