Attachments
You can add Client Documents, Task attachments, and Deliverables from the Field Nation Platform. An Attachments Response returns a work order’s folders and the files included in each folder. Work order attachments will always be included in a folder by default.
Attachments Response
Parameter | Type | Example | Mapping/Notes |
---|---|---|---|
sum | object | "sum": { "unreviewed": 1 } |
Total number of attachments Pending review. |
metadata | object | "metadata": { "total": 2 } |
Total number of folders. New work orders will always have two by default. |
results | array | "results": [ Documents Folder Misc Folder CustomFolder1 ] |
Attachment responses can include three folder types: Documents (default), Misc (default), and Custom Folders (optional). Work orders will always have a Documents and Misc folder. |
Examples
The Documents folder returns a slightly different response than the Misc and Custom Folder objects. Refer to Folders and Files for parameter details and additional examples.
Attachments Response, No Attachments
{
"correlation_id": "48b3ada9376a1e950cf2ff5be362a6aac189daf6",
"actions": [],
"sum": {
"unreviewed": 0
},
"metadata": {
"total": 2,
"per_page": 2,
"pages": 1,
"page": 1
},
"results": [
{
"id": 1,
"name": "Documents",
"type": "document",
"task": {
"id": 0
},
"actions": [
"upload"
],
"metadata": {
"total": 0,
"per_page": 0,
"pages": 1,
"page": 1
},
"results": []
},
{
"id": 2270,
"name": "Misc",
"min_files": 0,
"max_files": 999,
"min_bytes": 1,
"max_bytes": 104857600,
"type": "slot",
"task": {
"id": 0
},
"actions": [
"edit",
"delete",
"upload"
],
"metadata": {
"total": 0,
"per_page": 0,
"pages": 1,
"page": 1
},
"results": []
}
]
}
Attachments Response with multiple options
The example below includes two attachments in the Documents folder (Task attachment and Client Document), one attachment in the default Misc folder (Deliverable), and one Custom folder with a file that’s Pending review.
{
"correlation_id": "da769fae32075ce97ea2230cc49dc35e7bfd57b2",
"actions": [
"add_slot",
"download"
],
"sum": {
"unreviewed": 1
},
"metadata": {
"total": 3,
"per_page": 3,
"pages": 1,
"page": 1
},
"results": [
{
"id": 1,
"name": "Documents",
"type": "document",
"task": {
"id": 0
},
"actions": [
"upload"
],
"metadata": {
"total": 2,
"per_page": 2,
"pages": 1,
"page": 1
},
"results": [
{
"id": 176,
"author": {
"id": 756,
"first_name": "API",
"last_name": "User",
"thumbnail": "/images/missing-profile.png",
"phone": "+14805551234"
},
"created": {
"utc": "2018-12-19 17:24:59",
"local": {
"date": "2018-12-19",
"time": "11:24:59"
}
},
"file": {
"mime": "application/msword",
"thumbnail": "",
"name": "task file.docx",
"size_bytes": 1959,
"link": "",
"type": "file",
"icon": "icon-file-generic"
},
"show_before_assignment": false,
"task": {
"id": 22578
},
"notes": "",
"actions": [
"visibility",
"make_public",
"delete",
"notes",
"view"
],
"time_zone": {
"short": "EST"
}
},
{
"id": 175,
"author": {
"id": 756,
"first_name": "API",
"last_name": "User",
"thumbnail": "/images/missing-profile.png",
"phone": "+14805551234"
},
"created": {
"utc": "2018-12-19 16:17:29",
"local": {
"date": "2018-12-19",
"time": "10:17:29"
}
},
"file": {
"mime": "application/msword",
"thumbnail": "",
"name": "client documents.docx",
"size_bytes": 1961,
"link": "",
"type": "file",
"icon": "icon-file-generic"
},
"show_before_assignment": false,
"task": {
"id": 0
},
"notes": "Client Document Note",
"actions": [
"visibility",
"make_public",
"delete",
"notes",
"view"
],
"time_zone": {
"short": "EST"
}
}
]
},
{
"id": 5153,
"name": "Misc",
"min_files": 0,
"max_files": 999,
"min_bytes": 1,
"max_bytes": 104857600,
"type": "slot",
"task": {
"id": 0
},
"actions": [
"edit",
"delete",
"upload"
],
"metadata": {
"total": 1,
"per_page": 1,
"pages": 1,
"page": 1
},
"results": [
{
"id": 213,
"author": {
"id": 756,
"first_name": "API",
"last_name": "User",
"thumbnail": "/images/missing-profile.png",
"phone": "+14805551234"
},
"reviewer": {
"id": 756,
"first_name": "Techdoc",
"last_name": "Admin"
},
"file": {
"name": "deliverable.docx",
"mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.d",
"size_bytes": 1961,
"thumbnail": "",
"link": "",
"description": "Deliverable Note.",
"type": "file",
"icon": "icon-file-docx",
"preview": ""
},
"created": {
"utc": "2018-12-19 16:25:29",
"local": {
"date": "2018-12-19",
"time": "10:25:29"
}
},
"time_zone": {
"name": "America/Chicago",
"short": "CST"
},
"notes": "Deliverable Note.",
"status": "approved",
"status_description": "",
"task": {
"id": 0
},
"reviewed": {
"utc": "2018-12-19 16:25:30",
"local": {
"date": "2018-12-19",
"time": "10:25:30"
}
},
"show_before_assignment": false,
"actions": [
"notes",
"deny",
"reopen",
"view",
"delete",
"edit"
],
"folder_id": 5153,
"workorder_id": 3553
}
]
},
{
"id": 5978,
"name": "example_folder",
"min_files": 0,
"max_files": 999,
"min_bytes": 1,
"max_bytes": 104857600,
"type": "slot",
"task": {
"id": 0
},
"actions": [
"edit",
"delete",
"upload"
],
"metadata": {
"total": 1,
"per_page": 1,
"pages": 1,
"page": 1
},
"results": [
{
"id": 214,
"author": {
"id": 756,
"first_name": "API",
"last_name": "User",
"thumbnail": "/images/missing-profile.png",
"phone": "+14805551234"
},
"reviewer": {
"id": 0,
"first_name": "",
"last_name": ""
},
"file": {
"name": "folder deliverable.docx",
"mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.d",
"size_bytes": 1971,
"thumbnail": "",
"link": "",
"description": "Folder Note.",
"type": "file",
"icon": "icon-file-docx",
"preview": ""
},
"created": {
"utc": "2018-12-19 16:27:30",
"local": {
"date": "2018-12-19",
"time": "10:27:30"
}
},
"time_zone": {
"name": "America/Chicago",
"short": "CST"
},
"notes": "Folder Note.",
"status": "pending",
"status_description": "0",
"task": {
"id": 0
},
"reviewed": {
"utc": "",
"local": {
"date": "",
"time": ""
}
},
"show_before_assignment": false,
"actions": [
"notes",
"approve",
"deny",
"view",
"delete",
"edit"
],
"folder_id": 5978,
"workorder_id": 3553
}
]
}
]
}
Work Order Attachments Response
You can locate attachments in the work order > attachments object.
"attachments": { }
Work Order Attachments Response, No Attachments
"attachments": {
"correlation_id": "48b3ada9376a1e950cf2ff5be362a6aac189daf6",
"actions": [
"add_slot"
],
"sum": {
"unreviewed": 0
},
"metadata": {
"total": 2,
"per_page": 2,
"pages": 1,
"page": 1
},
"results": [
{
"id": 1,
"name": "Documents",
"type": "document",
"task": {
"id": 0
},
"actions": [
"upload"
],
"metadata": {
"total": 0,
"per_page": 0,
"pages": 1,
"page": 1
},
"results": []
},
{
"id": 2270,
"name": "Misc",
"min_files": 0,
"max_files": 999,
"min_bytes": 1,
"max_bytes": 104857600,
"type": "slot",
"task": {
"id": 0
},
"actions": [
"edit",
"delete",
"upload"
],
"metadata": {
"total": 0,
"per_page": 0,
"pages": 1,
"page": 1
},
"results": []
}
]
}