Add a note to a task (API)

This developer guide takes you through the steps to add a task note in the PassFort API 4.0.

What are task notes?

Notes provide a place to save text and files that aren't related to a check.

For example, you can:

  • Record conversations or actions that took place outside of PassFort.
  • Upload files like a PEP declaration form.

1. Select a profile

Choose any profile to add the application to, and get the profile's ID number (e.g. a2c4393a-e219-67a4-5ab4-2186952e9038). You'll need it to make the request in the next step.

If you haven't created the profile yet, follow these steps to create one via the API.
You can also create a profile via the portal. To get the profile ID, view the profile in the portal and copy the string of letters and numbers after /onboarding/ in the URL.

2. Get the task ID

To get a list of all tasks on a profile, make a request to the endpoint below.

Request endpoint:

POST https://api.passfort.com/4.0/profiles/{profile_id}/tasks

Sample response:

[
{
"check_ids": [ ],
"creation_date": "2020-03-09 12:18:40",
"form_instance_ids": [ ],
"id": "3d7a333c-418d-72a1-007b-06854dbb28eb",
"is_complete": false,
"is_expired": false,
"is_skipped": false,
"state": "INCOMPLETE",
"type": "COMPANY_MANUAL_TASK",
"variant": {
"id": "ddc72ea7-6e45-cc3b-dc52-30a94b9ec8c2",
"alias": "pep_declaration_form",
"name": "PEP declaration form",
"task_type": "COMPANY_MANUAL_TASK"
}
},
{
"check_ids": [ ],
"creation_date": "2020-03-09 12:18:40",
"form_instance_ids": [ ],
"id": "72aadb55-8b02-8495-d6b0-e1627ec23612",
"is_complete": true,
"is_expired": false,
"is_skipped": false,
"state": "COMPLETED_PASS",
"type": "COMPANY_IDENTIFY_OFFICERS",
"variant": {
"id": "5562c4e4-4d12-b16a-a151-7c9eed6816e9",
"alias": "identify_officers",
"name": "Identify officers",
"task_type": "COMPANY_IDENTIFY_OFFICERS"
}
}
]

Each object returned corresponds to one task. In the sample response above, the profile has two tasks.

Find the task you want to update by looking at the variant.alias of the task and making sure it matches the alias of the task you want to add the note to.

Get the id for the task you want to add the note to (e.g. 3d7a333c-418d-72a1-007b-06854dbb28eb).

If there are multiple versions of a task, use the one that has is_expired equal to false.

3. To include a file, add it to the profile

In PassFort, all files are added as images encoded in Base64.

To include a file with the note, first upload it as an image to the profile's files by making the following request.

The image size limit is 50MB. The following types are accepted: GIF, JPG, PNG, PDF, TIFF.
You can find free tools online to encode your images in Base64.

Request endpoint:

POST https://api.passfort.com/4.0/profiles/{profile_id}/files
This is a different resource than the document_images and documents resources used for document verification checks.

Body parameters :

When you make the POST request, include the following parameters in the body.

Key

Value

Description

data

Required

String

See the sample request body below for a sample value.

The image, encoded in Base64.

Optionally, the Base64-encoded image can be a URI string.

name

Optional

String

Sample value: PEP Declaration Form

The file name.

If you do not send this parameter, the file name will be "Untitled" in the portal.

In this example, an image of a file icon is added to the profile's files.

Sample request body:

{
"data": "iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAABMUlEQVR4Ae3YsTFAURhE4ZUAkAKIFAhEkIpFoAIAOQAJ0IYEAIAS4C07b+acv4H9Zm50RURE9K061KdNXeqj4I0pUL3m9V54eoxQpSPb+Ahhwjg9QGjRqz7KTBixzg4QDmxzQ4RzE0Apwr0NECL4AAZCHhAgeAEBghcQIDxYAQGCFxAgeAEBghcQIHgBAYIXECA8WgEBghcQIHgBAYIXECB4AQHCkwvwO0K5ANJY2QHSWNkB0lge4LzCPQMAACB6AF4AAABQbsArAAAAyg14AwAAQPQAvAMAAKDcgA8AAAAAAAAAAIDfVgEAAIDwFe46Ov9ahTuNAs5UuPEoYFyF6wl+bb2pU4ZmY4ApWarVWej9V8lUk9b++XvlXYuql7VuDWlbV38+/VIb6v/e2yciIvoEBh6x5m3tSdoAAAAASUVORK5CYII=",
"name": "PEP Declaration Form"
}

Sample response:

{
"decrypted_data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAABMUlEQVR4Ae3YsTFAURhE4ZUAkAKIFAhEkIpFoAIAOQAJ0IYEAIAS4C07b+acv4H9Zm50RURE9K061KdNXeqj4I0pUL3m9V54eoxQpSPb+Ahhwjg9QGjRqz7KTBixzg4QDmxzQ4RzE0Apwr0NECL4AAZCHhAgeAEBghcQIDxYAQGCFxAgeAEBghcQIHgBAYIXECA8WgEBghcQIHgBAYIXECB4AQHCkwvwO0K5ANJY2QHSWNkB0lge4LzCPQMAACB6AF4AAABQbsArAAAAyg14AwAAQPQAvAMAAKDcgA8AAAAAAAAAAIDfVgEAAIDwFe46Ov9ahTuNAs5UuPEoYFyF6wl+bb2pU4ZmY4ApWarVWej9V8lUk9b++XvlXYuql7VuDWlbV38+/VIb6v/e2yciIvoEBh6x5m3tSdoAAAAASUVORK5CYII=",
"id": "a7a57663-8d1b-c45b-73e2-19616ce0ebe5",
"name": "PEP Declaration Form"
}

The image id is returned in the response. You'll need it for the next step.

4. Create the note

To create the note, make a request to the endpoint below.

Request endpoint:

POST https://api.passfort.com/4.0/profiles/{profile_id}/tasks/{task_id}/notes

Body parameters:

When you make the POST request, you can include the following parameters in the body.

Key

Value

Description

attachments

Optional

Array of objects

See the sample request body below for a sample value.

Array of objects where each object corresponds to one image from the profile's files.

attachments.id

Required

String

Sample value: a7a57663-8d1b-c45b-73e2-19616ce0ebe5

The unique identifier for a document image.

text

Optional

String

Sample value: PEP declaration form completed 11/03/2020.

The text in the note.

author_name

Optional

String

Sample value: Morgan Rose

The name of the author of the note.

If you include this parameter, "custom name" is displayed next to the author's name in the portal.

If you do not include this parameter, the API key name is displayed as the author's name in the portal.

In this example, we'll create a note that includes text plus the example file from the previous step. We'll specify that the note was added by a user name Morgan Rose.

Sample request body:

{
"author_name": "Morgan Rose",
"text": "PEP declaration form completed 11/03/2020.",
"attachments": [
{
"id": "a7a57663-8d1b-c45b-73e2-19616ce0ebe5"
}
]
}

Sample response:

{
"attachments": [
{
"id": "a7a57663-8d1b-c45b-73e2-19616ce0ebe5"
}
],
"author_name": "Morgan Rose",
"author_name_customised": true,
"created_on": "2020-03-11 12:20:36",
"id": "22db2182-63d2-11ea-ac4a-f2b994e5d9cc",
"text": "PEP declaration form completed 11/03/2020."
}
To learn how to see all task notes, see Get notes on a task in the Developer Resources. To learn how to delete a task note, see Delete a note in the Developer Resources.


How did we do?


Powered by HelpDocs