Difference between revisions of "Fetch User Appointment"

From docs
Jump to: navigation, search
(Created page with "== Fetch User Appointments == === Base URL === https://apimobile.callproof.com === Endpoint === /api/ai/chat-bot/fetch-user-appointment === Purpose === Retrieves appointmen...")
 
(Fetch User Appointments)
 
Line 1: Line 1:
== Fetch User Appointments ==
+
==[[Mobile_API]] » Fetch User Appointments ==
  
 
=== Base URL ===
 
=== Base URL ===

Latest revision as of 15:34, 21 July 2026

Mobile_API » Fetch User Appointments

Base URL

https://apimobile.callproof.com

Endpoint

/api/ai/chat-bot/fetch-user-appointment

Purpose

Retrieves appointments for a specific user within a company for a given date range. Optionally filters to completed or incomplete appointments (based on whether the appointment was ended with Plus).

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

None.

Request Body

Parameter Type Required Description
userId integer Yes User whose appointments should be retrieved
companyId integer Yes Company identifier for the appointments
startDate string (date) Yes* Start of the date range (Y-m-d). Required by business logic even though format validation allows null
endDate string (date) Yes* End of the date range (Y-m-d). Required by business logic even though format validation allows null
completed integer No Appointment completion filter: 1 = completed (ended with Plus), 0 = not completed. Defaults to 0

Successful Response (200)

Returns matching appointments for the user and date range.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
data array List of appointment records
uri string Requested resource URI

data[]

Field Type Description
appointment_id integer Unique identifier of the appointment
contact_id integer Contact associated with the appointment
name string Company name of the contact
latitude number/string Contact latitude
longitude number/string Contact longitude
created string/datetime Appointment created timestamp
start string/datetime Appointment start timestamp
notes string Appointment notes
duration integer/number Appointment duration

Error Responses

Status Code Meaning
200 Validation failed – response body uses clientStatusCode 422 with the first validation error message
400 Bad Request – appointments could not be retrieved
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 422) – Missing/invalid userId or companyId, invalid date format, or invalid completed value.
  • 400 – Missing required date parameters ("Invalid input parameters."), or no appointments found ("No appointments found.").
  • 401 – Authentication failed or the access token is missing/expired.