Sign a Task and Upload Attachments

This section will explain how to upload attachments during signing a task. The following steps assume that the task owner also requests OTP verification. If no verification is required, please remove verify_info from the request body.

1. Request Sign a Task API

When requesting the Sign a Task API," include attachment_infos with the uploaded parameter set to false, indicating that the attachment has not yet been uploaded. Additionally, incorporate the verify_info referenced in the preceding section. The request body is as follows:

{
    "sign_infos": [
        {
            "field_object_id": "DottedSignAPI_gwf793298fgh8",
            "field_type": "textfield",
            "field_value": "My Name"
        },
        {
            "field_object_id": "DottedSignAPI_902j3d0hf92fd2",
            "field_type": "signature",
            "field_value": "555",
            "field_value_type": "signature"
        }
    ],
    "attachment_infos": [
        {
            "attachment_id": "attachment_1688_1",
            "attachment_type": "png",
            "uploaded": "false"
        },
        {
            "attachment_id": "attachment_1688_2",
            "attachment_type": "pdf",
            "uploaded": "false"
        }
    ],
    "verify_info": {
        "uuid": "138bdac7-1e81-4662-be08-de68a8346a95",
        "verify_data": "415049"
    }
}

2. Retrieve the Attachment Upload Links from the Error Message

{
    "error_code": 400051,
    "error_message": "attachment not ready: attachment_not_ready",
    "error_key": "attachment_not_ready",
    "attachment_upload_link": {
        "attachment_49417_1": {
            "mission_id": 228629,
            "upload_link": "https://dotted-sign.s3-accelerate.amazonaws.com/xxxxxx"
        },
        "attachment_49417_2": {
            "mission_id": 228630,
            "upload_link": "https://dotted-sign.s3-accelerate.amazonaws.com/xxxxxx"
        }
    },
    "identity_verify_token": "eyJhbGciOiJIUzUxMiJ9.eyJzdGFnZV90eXBlIjoiU2lnblN0YWdlIiwic3RhZ2VfaWQiOjQ5NDE3LCJ2ZXJpZnlfZm9yIjoiaWRlbnRpdHlfdmVyaWZ5IiwiY2xpZW50Ijoid2ViIiwiaXBfYWRkcmVzcyI6IjI0MDI6NzUwMDphNWY6ZDUzOmU5MmE6Njg4NTo2OGIxOjM2YzYiLCJ3b3JrX2lkIjoiZTNiNjQ2YjBhYTU1ZTJmOWJkMjc0ZDFlZDU2ZjQxY2Y2OTY5ZjU4Y2Y1OWE5NGIyYjc5ZjM1NDE2YmFlODg2MyIsInZlcmlmeV9hdCI6MTcxOTc2NTc2NSwidmVyaWZ5X3NvdXJjZSI6eyJFbWFpbCI6InJ5YW4ubGluK2d1ZXN0QGtkYW5tb2JpbGUuY29tIn0sInZlcmlmeV9vY2Nhc3Npb24iOiJzaWduIiwiZXhwaXJlZF9hdCI6MTcxOTc5NDU2NX0.ClQ2DWUIc2dmVVnnHUZKNhWkiJNoG9J3bLx2SxcgKcBcqmXAOq7cjjNFGMnq1u-xmnPwUeJU9HWasWxdavTxbQ"
}

3. Upload Attachments

Use the upload links (PUT method) and include the file (binary) in the request body to upload the respective attachment files.

For example:

curl --location --request PUT 'https://dotted-sign.s3-accelerate.amazonaws.com/xxxxxxxxxx' \
--header 'Content-Type: application/pdf' \
--data '@-NjZTQU-B/10mb.pdf'

4. Complete Signing a Task

Include the same request body as in the second step, with the uploaded parameter set to true. Then, request the Sign a Task API again to complete signing this stage.

Note: Signing tasks that involve uploading attachments will be completed asynchronously.