Difference between revisions of "API:Contacts:Updated"

From docs
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
== Updated Contacts ==
+
== [[API]] » Updated Contacts ==
  
'''URL:''' <nowiki>https://app.callproof.com/api/contacts/updated/</nowiki>
+
=== Base URL ===
 +
https://app.callproof.com
  
'''Method:''' GET
+
=== Endpoint ===
 +
/api/contacts/updated/
  
'''Required Fields:'''
+
=== Purpose ===
 +
Retrieves contacts whose records were updated within a specified date range for your CallProof company. Supports pagination so large volumes of contact changes can be synced in batches. Typically used to keep external systems in sync with contact profile changes, including phone numbers, assigned reps, and custom field values.
  
* '''''key''''' - API Key
+
=== HTTP Method ===
* '''''secret''''' - API Key Secret
+
GET
* '''''after''''' - Date/Time Contacts were updated after (e.g. '2014-08-10 12:34:56')
 
  
'''Optional Fields:'''
+
=== Headers ===
 +
No required headers.
  
* '''''before''''' - Date/Time Contacts were updated after (e.g. '2014-08-10 12:34:56')
+
{| class="wikitable"
* '''''offset''''' - Only 10 Contacts are returned per request, this field must be used to pull additional results when more are available
+
! Header !! Required !! Description
 +
|-
 +
| — || — || No headers are required for this endpoint. Authentication is provided via query parameters.
 +
|}
  
'''Data Returned:'''
+
=== Security ===
 +
* '''Yes''' – Requires a valid API key and secret with permission to read contacts.
  
* '''''results''''' - Array of Contacts
+
=== Parameters ===
* '''''more''''' - This field will be set if additional results are available
+
 
* '''''offset''''' - Current offset of the request
+
==== Query Parameters ====
* '''''errors''''' - Array of errors produced by the request
+
{| class="wikitable"
* '''''code''''' - HTTP request status
+
! 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.
 +
|-
 +
| after || datetime string || Yes || Return only contacts updated on or after this date/time. Invalid or missing values cause a validation error.
 +
|-
 +
| before || datetime string || No || Return only contacts updated on or before this date/time. If omitted, no upper date limit is applied.
 +
|-
 +
| offset || integer || No || Starting position for paginated results. Defaults to <code>0</code> if omitted or invalid.
 +
|}
 +
 
 +
==== Path Parameters ====
 +
None.
 +
 
 +
==== Request Body ====
 +
None.
 +
 
 +
=== cURL Example ===
 +
<pre>
 +
curl -X GET "https://app.callproof.com/api/contacts/updated/?key=YOUR_API_KEY&secret=YOUR_API_SECRET&after=2024-01-01"
 +
</pre>
 +
 
 +
=== Successful Response (200) ===
 +
Returns a paginated list of contacts updated within the requested date range. Up to 100 contacts are returned per request. If more matching contacts exist, <code>more</code> is set to <code>1</code> so the caller can request the next page using <code>offset</code>.
 +
 
 +
{| class="wikitable"
 +
! Field !! Type !! Description
 +
|-
 +
| results || array || List of contact objects (maximum 100 per response).
 +
|-
 +
| results[].id || integer || Unique identifier for the contact.
 +
|-
 +
| results[].company || string || Name of the contact company associated with the contact.
 +
|-
 +
| results[].contact_phones || array || Phone numbers associated with the contact.
 +
|-
 +
| results[].created_by || string || Display name of the user who created the contact.
 +
|-
 +
| results[].created_by_id || integer || User ID of the person who created the contact.
 +
|-
 +
| results[].created_by_email || string || Email address of the person who created the contact.
 +
|-
 +
| results[].contact_type || string || Contact type name.
 +
|-
 +
| results[].title || string || Contact title.
 +
|-
 +
| results[].first_name || string || Contact first name.
 +
|-
 +
| results[].last_name || string || Contact last name.
 +
|-
 +
| results[].email || string || Contact email address.
 +
|-
 +
| results[].address || string || Primary street address.
 +
|-
 +
| results[].address2 || string || Secondary street address.
 +
|-
 +
| results[].city || string || City.
 +
|-
 +
| results[].state || string || State or province name.
 +
|-
 +
| results[].zip || string || Postal/ZIP code.
 +
|-
 +
| results[].country || string || Country name.
 +
|-
 +
| results[].website || string || Website URL.
 +
|-
 +
| results[].latitude || string || Geographic latitude.
 +
|-
 +
| results[].longitude || string || Geographic longitude.
 +
|-
 +
| results[].last_contacted || string || Date and time of last contact (<code>YYYY-MM-DD HH:MM:SS</code>), or empty if none.
 +
|-
 +
| results[].default_phone || object || Default phone number details for the contact.
 +
|-
 +
| results[].account || string || Account number or identifier.
 +
|-
 +
| results[].invoice || string || Invoice-related value, if set.
 +
|-
 +
| results[].unknown || integer || <code>1</code> if marked unknown; otherwise <code>0</code>.
 +
|-
 +
| results[].assigned || integer || <code>1</code> if the contact is assigned; otherwise <code>0</code>.
 +
|-
 +
| results[].do_not_sms || integer || <code>1</code> if SMS is disabled for the contact; otherwise <code>0</code>.
 +
|-
 +
| results[].updated || string || Date and time the contact was last updated (<code>YYYY-MM-DD HH:MM:SS</code>).
 +
|-
 +
| results[].created || string || Date and time the contact was created (<code>YYYY-MM-DD HH:MM:SS</code>).
 +
|-
 +
| results[].custom_fields || array || Visible custom field values for the contact.
 +
|-
 +
| results[].custom_fields[].id || integer || Custom field identifier.
 +
|-
 +
| results[].custom_fields[].name || string || Custom field name.
 +
|-
 +
| results[].custom_fields[].value || string || Custom field display value.
 +
|-
 +
| results[].custom_fields[].value_id || string || Custom field option/value identifier, when applicable.
 +
|-
 +
| results[].reps || array || Sales representatives assigned to the contact.
 +
|-
 +
| results[].reps[].id || integer || Rep profile identifier.
 +
|-
 +
| results[].reps[].email || string || Rep email address.
 +
|-
 +
| results[].reps[].user_id || integer || Associated user account identifier.
 +
|-
 +
| results[].reps[].name || string || Rep display name.
 +
|-
 +
| results[].reps[].title || string || Rep job title.
 +
|-
 +
| results[].reps[].updated || string || Date and time the rep profile was last updated.
 +
|-
 +
| more || integer || <code>1</code> if additional matching contacts remain; <code>0</code> if this is the last page.
 +
|-
 +
| offset || integer || Offset value used for this request.
 +
|-
 +
| errors || array || Empty list when the request succeeds.
 +
|-
 +
| code || integer || HTTP-style status value; <code>200</code> on success.
 +
|}
 +
 
 +
==== Contact Phone Object Fields ====
 +
{| class="wikitable"
 +
! Field !! Type !! Description
 +
|-
 +
| id || integer || Unique identifier for the phone number.
 +
|-
 +
| last_contacted || string || Date and time this phone was last contacted.
 +
|-
 +
| unknown || integer || <code>1</code> if marked unknown; otherwise <code>0</code>.
 +
|-
 +
| do_not_call || integer || <code>1</code> if do-not-call is enabled; otherwise <code>0</code>.
 +
|-
 +
| contact_id || integer || Associated contact identifier.
 +
|-
 +
| contact || string || Contact display name.
 +
|-
 +
| phone_type || string || Phone type name (for example, Mobile or Office).
 +
|-
 +
| phone_number || string || Phone number.
 +
|-
 +
| ext || string || Phone extension, if any.
 +
|-
 +
| activated || string || Activation date/time, if set.
 +
|-
 +
| eligible || string || Eligibility date/time, if set.
 +
|-
 +
| call_result || string || Last call result, if any.
 +
|-
 +
| hidden || integer || <code>1</code> if the phone is hidden; otherwise <code>0</code>.
 +
|-
 +
| dealer_store || string || Associated dealer/store name, if any.
 +
|-
 +
| model || string || Model value, if any.
 +
|-
 +
| updated || string || Date and time the phone record was last updated.
 +
|-
 +
| created || string || Date and time the phone record was created.
 +
|}
 +
 
 +
Example response:
 +
<pre>
 +
{
 +
  "results": [
 +
    {
 +
      "id": 789,
 +
      "company": "Acme Corp",
 +
      "contact_phones": [
 +
        {
 +
          "id": 1001,
 +
          "last_contacted": "2024-06-15 14:30:00",
 +
          "unknown": 0,
 +
          "do_not_call": 0,
 +
          "contact_id": 789,
 +
          "contact": "John Doe",
 +
          "phone_type": "Mobile",
 +
          "phone_number": "5551234567",
 +
          "ext": "",
 +
          "activated": "",
 +
          "eligible": "",
 +
          "call_result": "",
 +
          "hidden": 0,
 +
          "dealer_store": "",
 +
          "model": "",
 +
          "updated": "2024-06-15 14:30:00",
 +
          "created": "2024-01-10 09:00:00"
 +
        }
 +
      ],
 +
      "created_by": "Jane Smith",
 +
      "created_by_id": 456,
 +
      "created_by_email": "rep@example.com",
 +
      "contact_type": "Prospect",
 +
      "title": "Manager",
 +
      "first_name": "John",
 +
      "last_name": "Doe",
 +
      "email": "john@acme.com",
 +
      "address": "123 Main St",
 +
      "address2": "",
 +
      "city": "Austin",
 +
      "state": "Texas",
 +
      "zip": "78701",
 +
      "country": "United States",
 +
      "website": "https://acme.com",
 +
      "latitude": "30.2672",
 +
      "longitude": "-97.7431",
 +
      "last_contacted": "2024-06-15 14:30:00",
 +
      "default_phone": {},
 +
      "account": "ACC-100",
 +
      "invoice": "",
 +
      "unknown": 0,
 +
      "assigned": 1,
 +
      "do_not_sms": 0,
 +
      "updated": "2024-06-15 14:30:00",
 +
      "created": "2024-01-10 09:00:00",
 +
      "custom_fields": [
 +
        {
 +
          "id": 12,
 +
          "name": "Industry",
 +
          "value": "Manufacturing",
 +
          "value_id": "3"
 +
        }
 +
      ],
 +
      "reps": [
 +
        {
 +
          "id": 123,
 +
          "email": "rep@example.com",
 +
          "user_id": 456,
 +
          "name": "Jane Smith",
 +
          "title": "Account Executive",
 +
          "updated": "2024-06-01 10:00:00"
 +
        }
 +
      ]
 +
    }
 +
  ],
 +
  "more": 0,
 +
  "offset": 0,
 +
  "errors": [],
 +
  "code": 200
 +
}
 +
</pre>
 +
 
 +
=== Error Responses ===
 +
{| class="wikitable"
 +
! Status Code !! Meaning
 +
|-
 +
| 400 || Bad Request – The required <code>after</code> parameter is missing or cannot be interpreted as a valid date/time.
 +
|-
 +
| 401 || Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read contacts.
 +
|-
 +
| 405 || Method Not Allowed – A method other than GET was used.
 +
|-
 +
| 500 || Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.
 +
|}
 +
 
 +
'''400 response body example:'''
 +
<pre>
 +
{
 +
  "results": [],
 +
  "errors": ["Invalid 'after' field"],
 +
  "code": 400
 +
}
 +
</pre>
 +
 
 +
'''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 12:01, 17 July 2026

API » Updated Contacts

Base URL

https://app.callproof.com

Endpoint

/api/contacts/updated/

Purpose

Retrieves contacts whose records were updated within a specified date range for your CallProof company. Supports pagination so large volumes of contact changes can be synced in batches. Typically used to keep external systems in sync with contact profile changes, including phone numbers, assigned reps, and custom field values.

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 contacts.

Parameters

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.
after datetime string Yes Return only contacts updated on or after this date/time. Invalid or missing values cause a validation error.
before datetime string No Return only contacts updated on or before this date/time. If omitted, no upper date limit is applied.
offset integer No Starting position for paginated results. Defaults to 0 if omitted or invalid.

Path Parameters

None.

Request Body

None.

cURL Example

curl -X GET "https://app.callproof.com/api/contacts/updated/?key=YOUR_API_KEY&secret=YOUR_API_SECRET&after=2024-01-01"

Successful Response (200)

Returns a paginated list of contacts updated within the requested date range. Up to 100 contacts are returned per request. If more matching contacts exist, more is set to 1 so the caller can request the next page using offset.

Field Type Description
results array List of contact objects (maximum 100 per response).
results[].id integer Unique identifier for the contact.
results[].company string Name of the contact company associated with the contact.
results[].contact_phones array Phone numbers associated with the contact.
results[].created_by string Display name of the user who created the contact.
results[].created_by_id integer User ID of the person who created the contact.
results[].created_by_email string Email address of the person who created the contact.
results[].contact_type string Contact type name.
results[].title string Contact title.
results[].first_name string Contact first name.
results[].last_name string Contact last name.
results[].email string Contact email address.
results[].address string Primary street address.
results[].address2 string Secondary street address.
results[].city string City.
results[].state string State or province name.
results[].zip string Postal/ZIP code.
results[].country string Country name.
results[].website string Website URL.
results[].latitude string Geographic latitude.
results[].longitude string Geographic longitude.
results[].last_contacted string Date and time of last contact (YYYY-MM-DD HH:MM:SS), or empty if none.
results[].default_phone object Default phone number details for the contact.
results[].account string Account number or identifier.
results[].invoice string Invoice-related value, if set.
results[].unknown integer 1 if marked unknown; otherwise 0.
results[].assigned integer 1 if the contact is assigned; otherwise 0.
results[].do_not_sms integer 1 if SMS is disabled for the contact; otherwise 0.
results[].updated string Date and time the contact was last updated (YYYY-MM-DD HH:MM:SS).
results[].created string Date and time the contact was created (YYYY-MM-DD HH:MM:SS).
results[].custom_fields array Visible custom field values for the contact.
results[].custom_fields[].id integer Custom field identifier.
results[].custom_fields[].name string Custom field name.
results[].custom_fields[].value string Custom field display value.
results[].custom_fields[].value_id string Custom field option/value identifier, when applicable.
results[].reps array Sales representatives assigned to the contact.
results[].reps[].id integer Rep profile identifier.
results[].reps[].email string Rep email address.
results[].reps[].user_id integer Associated user account identifier.
results[].reps[].name string Rep display name.
results[].reps[].title string Rep job title.
results[].reps[].updated string Date and time the rep profile was last updated.
more integer 1 if additional matching contacts remain; 0 if this is the last page.
offset integer Offset value used for this request.
errors array Empty list when the request succeeds.
code integer HTTP-style status value; 200 on success.

Contact Phone Object Fields

Field Type Description
id integer Unique identifier for the phone number.
last_contacted string Date and time this phone was last contacted.
unknown integer 1 if marked unknown; otherwise 0.
do_not_call integer 1 if do-not-call is enabled; otherwise 0.
contact_id integer Associated contact identifier.
contact string Contact display name.
phone_type string Phone type name (for example, Mobile or Office).
phone_number string Phone number.
ext string Phone extension, if any.
activated string Activation date/time, if set.
eligible string Eligibility date/time, if set.
call_result string Last call result, if any.
hidden integer 1 if the phone is hidden; otherwise 0.
dealer_store string Associated dealer/store name, if any.
model string Model value, if any.
updated string Date and time the phone record was last updated.
created string Date and time the phone record was created.

Example response:

{
  "results": [
    {
      "id": 789,
      "company": "Acme Corp",
      "contact_phones": [
        {
          "id": 1001,
          "last_contacted": "2024-06-15 14:30:00",
          "unknown": 0,
          "do_not_call": 0,
          "contact_id": 789,
          "contact": "John Doe",
          "phone_type": "Mobile",
          "phone_number": "5551234567",
          "ext": "",
          "activated": "",
          "eligible": "",
          "call_result": "",
          "hidden": 0,
          "dealer_store": "",
          "model": "",
          "updated": "2024-06-15 14:30:00",
          "created": "2024-01-10 09:00:00"
        }
      ],
      "created_by": "Jane Smith",
      "created_by_id": 456,
      "created_by_email": "rep@example.com",
      "contact_type": "Prospect",
      "title": "Manager",
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@acme.com",
      "address": "123 Main St",
      "address2": "",
      "city": "Austin",
      "state": "Texas",
      "zip": "78701",
      "country": "United States",
      "website": "https://acme.com",
      "latitude": "30.2672",
      "longitude": "-97.7431",
      "last_contacted": "2024-06-15 14:30:00",
      "default_phone": {},
      "account": "ACC-100",
      "invoice": "",
      "unknown": 0,
      "assigned": 1,
      "do_not_sms": 0,
      "updated": "2024-06-15 14:30:00",
      "created": "2024-01-10 09:00:00",
      "custom_fields": [
        {
          "id": 12,
          "name": "Industry",
          "value": "Manufacturing",
          "value_id": "3"
        }
      ],
      "reps": [
        {
          "id": 123,
          "email": "rep@example.com",
          "user_id": 456,
          "name": "Jane Smith",
          "title": "Account Executive",
          "updated": "2024-06-01 10:00:00"
        }
      ]
    }
  ],
  "more": 0,
  "offset": 0,
  "errors": [],
  "code": 200
}

Error Responses

Status Code Meaning
400 Bad Request – The required after parameter is missing or cannot be interpreted as a valid date/time.
401 Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to read contacts.
405 Method Not Allowed – A method other than GET was used.
500 Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.

400 response body example:

{
  "results": [],
  "errors": ["Invalid 'after' field"],
  "code": 400
}

401 response body example:

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

405 response body example:

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