Difference between revisions of "API:EventForms:Get"

From docs
Jump to: navigation, search
(Created page with "== API » Get Event Forms == '''URL:''' <nowiki>https://app.callproof.com/api/event_form/get/</nowiki> '''Method:''' GET '''Required Fields:''' * '''''key''''' - A...")
 
 
Line 1: Line 1:
 
== [[API]] &#187; Get Event Forms ==
 
== [[API]] &#187; Get Event Forms ==
  
'''URL:''' <nowiki>https://app.callproof.com/api/event_form/get/</nowiki>
+
=== Base URL ===
 +
https://app.callproof.com
  
'''Method:''' GET
+
=== Endpoint ===
 +
/api/event_form/get/
  
'''Required Fields:'''
+
=== Purpose ===
 +
Retrieves the event form definitions configured for your CallProof company, including each form’s custom fields. Use this to obtain available event forms and the field structure used when submitting event form responses for contacts.
  
* '''''key''''' - API Key
+
=== HTTP Method ===
* '''''secret''''' - API Key Secret
+
GET
  
'''Data Returned:'''
+
=== Headers ===
 +
No required headers.
  
* '''''results''''' - Companies Event Forms
+
{| class="wikitable"
* '''''errors''''' - Array of errors produced by the request
+
! Header !! Required !! Description
* '''''code''''' - HTTP request status
+
|-
 +
| — || — || No headers are required for this endpoint. Authentication is provided via query parameters.
 +
|}
 +
 
 +
=== Security ===
 +
* '''Yes''' – Requires a valid API key and secret with permission to read event forms.
 +
 
 +
=== Parameters ===
 +
 
 +
==== Path Parameters ====
 +
None.
 +
 
 +
==== Query Parameters ====
 +
{| class="wikitable"
 +
! Parameter !! Type !! Required !! Description
 +
|-
 +
| key || string || Yes || Public API key assigned to your CallProof account.
 +
|-
 +
| secret || string || Yes || Private API secret paired with the API key.
 +
|}
 +
 
 +
==== Request Body ====
 +
None.
 +
 
 +
=== cURL Example ===
 +
<pre>
 +
curl -X GET "https://app.callproof.com/api/event_form/get/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"
 +
</pre>
 +
 
 +
=== Successful Response (200) ===
 +
Returns the event forms available for your company, ordered by their configured position. Each form includes its visible custom fields.
 +
 
 +
{| class="wikitable"
 +
! Field !! Type !! Description
 +
|-
 +
| results || array || List of event form definitions.
 +
|-
 +
| results[].id || integer || Unique identifier for the event form.
 +
|-
 +
| results[].name || string || Display name of the event form.
 +
|-
 +
| results[].custom_fields || array || Custom fields included on the event form.
 +
|-
 +
| results[].custom_fields[].id || integer || Unique identifier for the custom field.
 +
|-
 +
| results[].custom_fields[].name || string || Custom field display name.
 +
|-
 +
| results[].custom_fields[].cfield_table || string || Business area associated with the custom field.
 +
|-
 +
| results[].custom_fields[].cfield_type || string || Type of custom field.
 +
|-
 +
| results[].custom_fields[].cfield_option_default || string || Default option name, or empty if none.
 +
|-
 +
| results[].custom_fields[].rfield || string || Related regular field name, when applicable.
 +
|-
 +
| results[].custom_fields[].cfield || string || Linked/parent custom field name, when applicable.
 +
|-
 +
| results[].custom_fields[].position || integer || Display order position.
 +
|-
 +
| results[].custom_fields[].points || integer || Points value assigned to the field.
 +
|-
 +
| results[].custom_fields[].hide_on_checkout || string || <code>1</code> if hidden during checkout; otherwise <code>0</code>.
 +
|-
 +
| results[].custom_fields[].options || array || Selectable options configured for the custom field.
 +
|-
 +
| results[].custom_fields[].options[].id || integer || Unique identifier for the option.
 +
|-
 +
| results[].custom_fields[].options[].name || string || Option display name.
 +
|-
 +
| results[].custom_fields[].options[].cfield_id || integer || Identifier of the custom field that owns the option.
 +
|-
 +
| results[].custom_fields[].options[].cfield || string || Name of the custom field that owns the option.
 +
|-
 +
| results[].custom_fields[].options[].is_default || string || <code>1</code> if this option is a default option; otherwise <code>0</code>.
 +
|-
 +
| results[].custom_fields[].options[].position || integer || Option display order position.
 +
|-
 +
| results[].custom_fields[].options[].points || integer || Points value assigned to the option.
 +
|-
 +
| code || integer || HTTP-style status value; <code>200</code> on success.
 +
|}
 +
 
 +
Example response:
 +
<pre>
 +
{
 +
  "results": [
 +
    {
 +
      "id": 15,
 +
      "name": "Site Visit Form",
 +
      "custom_fields": [
 +
        {
 +
          "id": 12,
 +
          "name": "Visit Outcome",
 +
          "cfield_table": "event_form",
 +
          "cfield_type": "select",
 +
          "cfield_option_default": "Successful",
 +
          "rfield": "",
 +
          "cfield": "",
 +
          "position": 1,
 +
          "points": 0,
 +
          "hide_on_checkout": "0",
 +
          "options": [
 +
            {
 +
              "id": 201,
 +
              "name": "Successful",
 +
              "cfield_id": 12,
 +
              "cfield": "Visit Outcome",
 +
              "is_default": "1",
 +
              "position": 1,
 +
              "points": 0
 +
            }
 +
          ]
 +
        }
 +
      ]
 +
    }
 +
  ],
 +
  "code": 200
 +
}
 +
</pre>
 +
 
 +
=== Notes ===
 +
* Returns only event forms belonging to your company.
 +
* Forms are ordered by their configured position.
 +
* Hidden fields and image fields are excluded from the returned custom field lists.
 +
* If no event forms are configured, the response returns an empty <code>results</code> list with status <code>200</code>.
 +
* This endpoint returns form definitions, not submitted event form responses for a contact.
 +
* To retrieve submitted event form responses for a contact, use <code>/api/contact/event_form/get/</code>.
 +
* This response does not include an <code>errors</code> field on success.
 +
 
 +
=== Error Responses ===
 +
{| class="wikitable"
 +
! Status Code !! Meaning
 +
|-
 +
| 401 || Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read event forms.
 +
|-
 +
| 405 || Method Not Allowed – A method other than GET was used.
 +
|-
 +
| 500 || Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.
 +
|}
 +
 
 +
'''401 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Invalid API Key"],
 +
  "code": 401
 +
}
 +
</pre>
 +
 
 +
'''405 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Method not allowed"],
 +
  "code": 405
 +
}
 +
</pre>

Latest revision as of 14:50, 17 July 2026

API » Get Event Forms

Base URL

https://app.callproof.com

Endpoint

/api/event_form/get/

Purpose

Retrieves the event form definitions configured for your CallProof company, including each form’s custom fields. Use this to obtain available event forms and the field structure used when submitting event form responses for contacts.

HTTP Method

GET

Headers

No required headers.

Header Required Description
No headers are required for this endpoint. Authentication is provided via query parameters.

Security

  • Yes – Requires a valid API key and secret with permission to read event forms.

Parameters

Path Parameters

None.

Query Parameters

Parameter Type Required Description
key string Yes Public API key assigned to your CallProof account.
secret string Yes Private API secret paired with the API key.

Request Body

None.

cURL Example

curl -X GET "https://app.callproof.com/api/event_form/get/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"

Successful Response (200)

Returns the event forms available for your company, ordered by their configured position. Each form includes its visible custom fields.

Field Type Description
results array List of event form definitions.
results[].id integer Unique identifier for the event form.
results[].name string Display name of the event form.
results[].custom_fields array Custom fields included on the event form.
results[].custom_fields[].id integer Unique identifier for the custom field.
results[].custom_fields[].name string Custom field display name.
results[].custom_fields[].cfield_table string Business area associated with the custom field.
results[].custom_fields[].cfield_type string Type of custom field.
results[].custom_fields[].cfield_option_default string Default option name, or empty if none.
results[].custom_fields[].rfield string Related regular field name, when applicable.
results[].custom_fields[].cfield string Linked/parent custom field name, when applicable.
results[].custom_fields[].position integer Display order position.
results[].custom_fields[].points integer Points value assigned to the field.
results[].custom_fields[].hide_on_checkout string 1 if hidden during checkout; otherwise 0.
results[].custom_fields[].options array Selectable options configured for the custom field.
results[].custom_fields[].options[].id integer Unique identifier for the option.
results[].custom_fields[].options[].name string Option display name.
results[].custom_fields[].options[].cfield_id integer Identifier of the custom field that owns the option.
results[].custom_fields[].options[].cfield string Name of the custom field that owns the option.
results[].custom_fields[].options[].is_default string 1 if this option is a default option; otherwise 0.
results[].custom_fields[].options[].position integer Option display order position.
results[].custom_fields[].options[].points integer Points value assigned to the option.
code integer HTTP-style status value; 200 on success.

Example response:

{
  "results": [
    {
      "id": 15,
      "name": "Site Visit Form",
      "custom_fields": [
        {
          "id": 12,
          "name": "Visit Outcome",
          "cfield_table": "event_form",
          "cfield_type": "select",
          "cfield_option_default": "Successful",
          "rfield": "",
          "cfield": "",
          "position": 1,
          "points": 0,
          "hide_on_checkout": "0",
          "options": [
            {
              "id": 201,
              "name": "Successful",
              "cfield_id": 12,
              "cfield": "Visit Outcome",
              "is_default": "1",
              "position": 1,
              "points": 0
            }
          ]
        }
      ]
    }
  ],
  "code": 200
}

Notes

  • Returns only event forms belonging to your company.
  • Forms are ordered by their configured position.
  • Hidden fields and image fields are excluded from the returned custom field lists.
  • If no event forms are configured, the response returns an empty results list with status 200.
  • This endpoint returns form definitions, not submitted event form responses for a contact.
  • To retrieve submitted event form responses for a contact, use /api/contact/event_form/get/.
  • This response does not include an errors field on success.

Error Responses

Status Code Meaning
401 Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read event forms.
405 Method Not Allowed – A method other than GET was used.
500 Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.

401 response body example:

{
  "results": [],
  "errors": ["Invalid API Key"],
  "code": 401
}

405 response body example:

{
  "results": [],
  "errors": ["Method not allowed"],
  "code": 405
}