2. Initiate Signing Process

The obtained signing identity and txId during the previous step needs to be passed in the next API call along with the single or multiple documents to be signed.

PUT http://localhost:8080/v2/signature/request

Headers

NameValue

Content-Type

multipart/form-data

Body

NameDescription

digestAlgorithm

SHA256

signIdentityId

ckqtokgre4o5mrk4bajtk413ui

txId

90ca005cfb4d4827b1247889166b72fe

file

file1.pdf file2.pdf

sigProp

{ "signPropDetail": [ { "fileName": "file1.pdf", "signInfo": "1:50, 50, 200,200]" }, { "fileName": "file2.pdf", "signInfo": "1:[50,50,200,200]" } ] }

Response

{
  ```
https://stg-id.uaepass.ae/trustedx-authserver/oauth/hsign-as?response_type=code&client_id=sandbox_stage&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fv2%2Fsignature%2Ftoken&scope=urn:uae:digitalid:backend_api:hash_signing urn:safelayer:eidas:sign:identity:use:server&state=1434459749&digests_summary=npBScEri0PAqJ8yWz11jvcjFOlzVkDijlM-osjrX98k%3D&digests_summary_algorithm=SHA256&sign_identity_id=ckqtokgre4o5mrk4bajtk413ui
```
}

Provide the below values for “signProp” parameter in the API call. The values should be adjusted accordingly as per the files.

{
  "signPropDetail": [
    {
      "fileName": "sample1.pdf",
      "signInfo": "1:[50, 600, 200, 100]"
    },
    {
      "fileName": "sample2.pdf",
      "signInfo": "1:[50, 600, 200, 100]"
    }
  ]
}

Description of parameters in the above request body:

filename

The name of the file that needs to be signed. It should be exactly same as the selected one.

signInfo

Page number and the signing position on the specified page. The first 2 values (50,600) specify the values for lower left corner X,Y coordinates and other two 200,100) represent the upper right corner X,Y coordinates.

txId(mandatory)

Transaction id for signing request.

Note: Transaction ID is valid for only 10 minutes and operation should end within the same period.

digestAlgorithm(mandatory)

Entity can use one of the digest algorithms from below according to their requirement:

SHA256

SHA384

SHA512

signIdentityId(mandatory)

User’s qualified certificate id

file(mandatory)

Pdf file which is to be signed

signProp

As described above

Sample Curl Command

curl --location --request PUT 'http://localhost:8080/v2/signature/request' \
--header 'Content-Type: multipart/form-data' \
--form 'digestAlgorithm="SHA256"' \
--form 'signIdentityId="49o09dt4v47lvd2r14tesod0at"' \
--form 'txId="4f1068dbe3f64aefa45ada9555c9ba0b"' \
--form 'file=@"/C:path to file/file1.pdf"' \
--form 'file=@"/C:path to file/file2.pdf"' \
--form 'sigProp="{
  \"signPropDetail\": [
    {
      \"fileName\": \"file1.pdf\",
      \"signInfo\": \"1:50, 50, 200,200]\"

    },
    {
      \"fileName\": \"file2.pdf\",
      \"signInfo\": \"1:[50,50,200,200]\"
    }
  ]
}"'

Last updated