Task Completion

From docs
Revision as of 15:50, 21 July 2026 by Ashley DeBon (talk | contribs) (Retrieve Task Completion Details)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Mobile_API »Retrieve Task Completion Details

Base URL

https://apimobile.callproof.com

Endpoint

/api/ai/chat-bot/task-completion

Purpose

Returns a paginated list of tasks (follow-ups and appointments) for a given user, so AI or mobile experiences can answer questions such as past-due follow-ups or tasks completed in a date range. Results can be filtered by date range, task type, and completion status, and each item includes task schedule details plus related contact information.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

Parameter Type Required Description
page integer No Page number for pagination (default page size is 5)

Body Parameters

Parameter Type Required Description
user_id integer Yes User whose tasks should be returned
start_date string No Start of date filter in `d-m-Y` format (for example, `01-07-2026`)
end_date string No End of date filter in `d-m-Y` format (for example, `17-07-2026`)
task_type string No Comma-separated task type IDs to include
task_status number No `0` for incomplete (not completed or null); any other provided value filters to completed tasks
task_priority integer No Optional priority filter applied when provided
search string No Optional contact name search (first or last name) applied when provided

Successful Response (200)

Field Type Description
clientStatusCode integer Business status code (`200` on success)
user_id integer Authenticated user ID
company_id integer Authenticated user’s company ID
data array List of task completion items for the current page
data[].task_id integer Task or appointment ID
data[].task_type_id integer/string Task type ID
data[].task_type_name string Task type name
data[].task_priority_id integer Priority ID (follow-up tasks; default Medium when missing)
data[].task_priority_name string Priority name (follow-up tasks)
data[].task_date string Task date in user’s timezone (`m-d-Y`)
data[].task_time string Task time in user’s timezone (for example, `3:30 PM`)
data[].task_duration mixed Task duration
data[].task_notes string Notes on the task
data[].task_schedule_time string Human-readable schedule (weekday, date, and time)
data[].task_completed boolean Whether the task is completed
data[].contact_id integer/string Related contact ID
data[].contact_name string Related contact or company display name
data[].contact_phone string Related contact phone
data[].contact_people mixed Related people on the contact
data[].contact_sales_rep string Sales representative associated with the contact
data[].contact_contacted string Last contacted display value
data[].contact_address1 string Address line 1
data[].contact_address2 string Address line 2
data[].contact_latitude mixed Latitude
data[].contact_longitude mixed Longitude
data[].contact_datetime integer Unix timestamp of the scheduled time in the user’s timezone
data[].is_appointment boolean `true` when the item is an appointment; `false` for a follow-up task
firstItemOnPage integer Index of the first item on the page
lastItemOnPage integer Index of the last item on the page
hasNextPage boolean Whether a next page exists
hasPreviousPage boolean Whether a previous page exists
isFirstPage boolean Whether this is the first page
isLastPage boolean Whether this is the last page
next_page_url string/null URL for the next page
prev_page_url string/null URL for the previous page
first_page_url string/null URL for the first page
last_page_url string/null URL for the last page
pageCount integer Total number of pages
pageNumber integer Current page number
pageSize integer Items per page (`5`)
totalItemCount integer Total matching items
uri string Requested endpoint URL

Error Responses

Validation Error

HTTP status is typically `200`, with `clientStatusCode` `422`.

Field Type Description
clientStatusCode integer `422`
error.code string/integer Error code
error.message string First validation message (for example, missing `user_id` or invalid date format)
uri string Requested endpoint URL

Business / Retrieval Error

HTTP status is typically `200`, with `clientStatusCode` `400`.

Field Type Description
clientStatusCode integer `400`
error.code string/integer Error code
error.message string Failure message (for example, error retrieving task details)
uri string Requested endpoint URL

Unauthorized

Returned when the Bearer token is missing, invalid, or expired (middleware: token expiry and API auth).