Edit PDF files of a Task or a Template

DottedSign’s PDF editing feature allows users to edit draft tasks (before they are sent to others) and template PDF files. However, this feature is only supported for tasks and templates created via the web or by uploading multiple PDF files.

Below is an example demonstrating how to update task PDF files, outlining the steps involved in editing:

1. Retrieve the File Mission associated with the Task

You can obtain the corresponding file_mission_id from the file_mission_info field in the response of the Get a Task API.

{
  "data": {
    "task_id": 399,
    "status": "draft",
    "file_mission_info": {
      "file_mission_id": 12,
      "status": "completed"
    },
    ...
  }
}

2. Get Details of the File Mission

Use the Get a file mission API to retrieve detailed information, including each PDF’s file_object_id, file_name, page_count, and checksum. These values will be used in the subsequent steps.

{
  "data": {
    "file_mission_id": 12,
    "status": "completed",
    "files": [
      {
        "file_object_id": "file_object_id_1",
        "file_name": "file_name_1",
        "page_count": 1,
        "checksum": "checksum1"
      },
      {
        "file_object_id": "file_object_id_2",
        "file_name": "file_name_2",
        "page_count": 1,
        "checksum": "checksum2"
      }
    ]
  }
}

3. Renew the File Mission

Use the Renew a file mission API to update the file mission. This will return a new file_mission_id along with upload links for replacing or adding PDF files (similar to the process used when creating a task with multiple PDF files).

🚧

Notice

For any PDF you don't want to modify, you must retain and include its file_object_id, file_name, page_count, and checksum from Step 2. Otherwise, the system will assume the file has been changed and needs to be re-uploaded.

Add a new PDF file

{
    "file_mission_id": 12,
    "file_objects": [
      {
        "file_object_id": "file_object_id_1",
        "file_name": "file_name_1",
        "page_count": 1,
        "checksum": "checksum1"
      },
      {
        "file_object_id": "file_object_id_2",
        "file_name": "file_name_2",
        "page_count": 1,
        "checksum": "checksum2"
      },
      {
        "file_name": "this is new PDF"
      }
    ]
}

Remove a PDF file

{
    "file_mission_id": 12,
    "file_objects": [
      {
        "file_object_id": "file_object_id_2",
        "file_name": "file_name_2",
        "page_count": 1,
        "checksum": "checksum2"
      }
    ]
}

Replace a PDF file

{
    "file_mission_id": 12,
    "file_objects": [
      {
        "file_object_id": "file_object_id_1",
        "file_name": "file_name_1",
        "page_count": 1,
        "checksum": "checksum1"
      },
      {
        "file_object_id": "file_object_id_2",
        "file_name": "file_name_2"
      }
    ]
}

Reorder PDF files

{
    "file_mission_id": 12,
    "file_objects": [
      {
        "file_object_id": "file_object_id_2",
        "file_name": "file_name_2",
        "page_count": 1,
        "checksum": "checksum2"
      },
      {
        "file_object_id": "file_object_id_1",
        "file_name": "file_name_1",
        "page_count": 1,
        "checksum": "checksum1"
      }
    ]
}

4. Update the File Mission of the Task

After completing the PDF uploads mentioned in the third step, you must use the Update a Task API to update the file_mission_id of the task.

🚧

Important

If this step is skipped, PDF files of the task will not be updated.