Skip to content
Last updated

Lean - uploadDoc method

You can use this method to store documents linked to the issued disposable:

  • the evidence of the identification
  • signed contracts (eg. CA22D)
  • audit log of the signature process

Note: If the disposable is issued with the enrollDisposableWitheIDAssertion method you don't need to upload the assertion with this method. In this case the assertion is automatically stored.

For the full technical reference, see the OpenAPI specification.

Endpoint

POST /api/document/{lraId}/uploadDoc

Headers

NameRequiredDescription
Content-TypeYesMust be application/json.
AuthorizationYesBasic Auth credentials.

Path parameters

ParameterTypeRequiredDescription
lraIdintegerYesLRA identifier.

Body parameters

ParameterTypeRequiredDescription
deviceCodestringYesThe device code of the issued certificate.
idOtpintegerYesThe OTP identification associated to the disposable. Use 0 if otpType=NO_OTP.
typeDocstringYesDocument type. Allowed values: IDENTIFICATION_DOC, CONTRACT, AUDIT_LOG, IDENTITY_ASSERTION.
extensionstringYesFile extension (not case-sensitive). Allowed: pdf, zip, png, jpeg, jpg, docx, doc, odt, xml, json, txt, mp4, m4a, m4v.
filestringYesFile content, base64 encoded.
externalKeystringNoAn external reference to the file.

Request example

{
    "idOtp": 2587763,
    "deviceCode": "RHIDP2412011111111",
    "externalKey": "external_key_sample",
    "file": "encoded base 64 file",
    "extension": "pdf",
    "typeDoc": "CONTRACT"
}

Response examples

200 — Document uploaded

{
    "deviceCode": "RHIDP2412011111111",
    "typeDoc": "CONTRACT",
    "externalKey": "external_key_sample",
    "uploadDate": 1733496805136,
    "filename": "3333217_a4ece4b3e9626ccfd3bac2eb77c0c1d7950be77e190a64fcf1957279e677ffc7.pdf"
}

uploadDate is returned as a Unix timestamp in milliseconds (e.g. 1733496805136 = 2024-12-06T10:13:25Z).

Error codes

All errors below return HTTP 500.

Error codeDescription
242Input parameter invalid
1027The document is duplicated
1028The file exceeds the maximum size limit

Error code 242 is returned when an invalid parameter is passed. Examples:

{
  "code": 242,
  "message": "deviceCode: should not be null"
}
{
  "code": 242,
  "message": "extension: value 'docx' is not allowed"
}

The parameters that can trigger error 242 are: deviceCode, lraid, idOtp, extension, typeDoc.

For authentication errors, see Authentication.