EventForm Store Process

From docs
Jump to: navigation, search

Mobile_API »Store Event Form

Base URL

https://apimobile.callproof.com

Endpoint

/api/contact/{contact_id}/eventformstore/{event_form_id}

Purpose

Creates a new event form submission for a contact. Saves field values, optionally links people, can create a scheduled follow-up task, records location, and may send notification emails. If an appointment is ended as part of this submit, a different success message is returned.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

Parameter Type Required Description
contact_id integer Yes Unique identifier of the contact
event_form_id integer Yes Unique identifier of the event form being submitted

Query Parameters

None.

Request Body

Parameter Type Required Description
form_field string (JSON array) Yes JSON array of field values to save for the submission
people string (JSON array) No JSON array of people to link to the submission (each item includes id)
schedule_task string (JSON) No Optional schedule/follow-up task details (see below)
latitude string/number No Latitude for the submission location (falls back to user profile/last login location when omitted)
longitude string/number No Longitude for the submission location (falls back to user profile/last login location when omitted)

form_field[] fields

Parameter Type Required Description
name string Conditional Field display name (used in required-field error messages)
custom_field_id integer Yes* Custom field identifier
custom_field_type_id integer Yes* Field type identifier
value string Conditional Field value (required when the field is marked required and no option default is set)
custom_field_option_default_id string Conditional Selected option ID(s) for select/radio/multi-select fields
required boolean No Whether the field is required

schedule_task fields (when provided)

Parameter Type Required Description
task_date string Yes* Task date
task_hour string/integer Yes* Hour portion of the task time
task_min string/integer Yes* Minute portion of the task time
task_meridiem string Yes* AM/PM indicator
task_assignment string Yes* Comma-separated user IDs assigned to the follow-up
task_people string No Comma-separated personnel IDs related to the task
duration string/integer No Task duration
send_google_cal boolean/integer No Whether to send a Google Calendar invite

\* Required when that part of the payload is used / validated by the create flow.

cURL Example for Android

 curl --location --request POST 'https://apimobile.callproof.com/api/contact/{contact_id}/eventformstore/{event_form_id}' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'form_field=[{"custom_field_id":1,"custom_field_type_id":1,"value":"YOUR_VALUE"}]' 

cURL Example for iOS

 curl --location --request POST 'https://apimobile.callproof.com/api/contact/{contact_id}/eventformstore/{event_form_id}' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'form_field=[{"custom_field_id":1,"custom_field_type_id":1,"value":"YOUR_VALUE"}]' 


Successful Response (200)

Indicates that the event form was saved successfully.

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
message string Confirmation message (for example, "Event Form has been saved." or "Your appointment has been saved.")
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation failed – response body uses clientStatusCode 401 with the first validation error message
400 Bad Request – the event form could not be saved
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Missing form_field.
  • 400 – Invalid contact ID ("ContactId is Invalid"), invalid event form ID ("EventFormId is Invalid"), required field missing (for example, "<Field Name> Required"), invalid field type mapping, schedule task assignment error, or another create error (for example, "Error while Adding EventForm").
  • 401 – Authentication failed or the access token is missing/expired.