Easymailing
Tasks

Complete a task

PUT /tasks/{uuid}/actions/complete

PUT/tasks/{uuid}/actions/complete

Marks a task as done: it becomes completed, with the time and the person who completed it. Its reminder is removed.

When to use: When the user says a task is done. It is safe to repeat: completing an already completed task changes nothing.

When not to use: To bring a completed task back to pending, use reopen_task. To remove a task that should not exist, use delete_task. Completing a call or email task does not make the call or send the email.

Side effects: A task.completed entry appears in the activity of each record the task is linked to, done by the person who owns the token (marked «via Maia» when Maia made the request). Its due date stays, but a completed task is no longer overdue. The reminder is removed and the assignee's pending assignment and reminder notices are withdrawn. Completing a task that is already completed adds nothing. Nothing is sent and no automation or webhook fires.

Permissions: Requires a CRM seat and the crm.tasks_notes.write capability. The user must also be able to see every contact, company and opportunity the task is linked to (crm.contacts_companies.read for contacts and companies, access to the pipeline for opportunities).

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

uuid*string

UUID of the task. Get it from list_tasks.

Formatuuid

Request Body

The updated Task resource

TypeScript Definitions

Use the request body type in TypeScript.

Tasks of the public API (plan fase 4, Tasks 17 and 18). The reads are generated from the approved proposal by fase-4/tools/gen_task_read.py and the writes by fase-4/tools/gen_task_write.py, edited by hand afterwards: the texts are the proposal's. Every operation checks the CRM access in its provider or processor before anything else, because API Platform evaluates security after the provider.

list_tasks pages by cursor (paginationViaCursor goes on the resource: on the operation API Platform 3.4.17 loses it) and gives no total. cursor is the opaque position of each task, which API Platform copies into the cursor[gt] of hydra:next (the last item) and the cursor[lt] of hydra:previous (the first one); it is never published. assignee, completed_by and created_by are arrays so that they keep the shape of the proposal; the related records are {@see \App\Application\Crm\RecordRelationView} arrays.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://api.easymailing.com/tasks/7c1e5a90-3b24-4d8f-a6e1-0f9d2c4b8a13/actions/complete" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "expected_version": 1  }'
{  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "title": "string",  "description_html": "string",  "status": "open",  "priority": "none",  "type": "general",  "assignee": {    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",    "name": "string",    "email": "user@example.com"  },  "due_at": "2019-08-24T14:15:22Z",  "overdue": true,  "reminder_offset_minutes": 0,  "reminder_at": "2019-08-24T14:15:22Z",  "completed_at": "2019-08-24T14:15:22Z",  "completed_by": {    "kind": "user",    "name": "string"  },  "created_by": {    "kind": "user",    "name": "string"  },  "initiated_via": "ui",  "contacts": [    {      "iri": "/entity/1",      "label": "string",      "secondary": "string"    }  ],  "companies": [    {      "iri": "/entity/1",      "label": "string",      "secondary": "string"    }  ],  "opportunities": [    {      "iri": "/entity/1",      "label": "string",      "secondary": "string"    }  ],  "version": 0,  "can_edit": true,  "can_delete": true,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}