Retrieve Single Opportunity by Contact ID

From docs
Jump to: navigation, search

Retrieve Contact Opportunities by Contact ID

Base URL

https://apimobile.callproof.com

Endpoint

/api/contacts/{id}/opportunities

Purpose

Returns a paginated list of sales opportunities linked to a specific contact. Each opportunity includes name, stage, type, value, probability, owner, closing date, linked people and accounts, custom fields, and related location details so users can review the contact’s opportunity pipeline.

HTTP Method

GET

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

Parameter Type Required Description
id integer Yes Unique identifier of the contact whose opportunities are requested

Query Parameters

Parameter Type Required Description
sort_by integer No Sort order for results. 1 = oldest created first, 2 = newest created first. If omitted, opportunities are sorted by closing date ascending
search string No Search text used to filter opportunities by opportunity name
page integer No Page number for paginated results

Request Body

None.

cURL Example for Android

curl --location 'https://apimobile.callproof.com/api/contacts/{id}/opportunities' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

cURL Example for iOS

curl --location 'https://apimobile.callproof.com/api/contacts/{id}/opportunities' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Successful Response (200)

Indicates that opportunities for the specified contact were retrieved successfully. The response includes opportunity records for the current page plus pagination metadata.

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 object Opportunity list payload
data.opportunities array List of opportunities for the current page
data.opportunities[].opportunity_id integer Unique opportunity identifier
data.opportunities[].contact_id integer Related contact identifier
data.opportunities[].associated_account_name string Company / account name associated with the opportunity
data.opportunities[].contact_type_id integer / string Contact type identifier
data.opportunities[].contact_type string Contact type name
data.opportunities[].name string Opportunity name
data.opportunities[].stage string Opportunity stage name
data.opportunities[].stage_id integer Opportunity stage identifier
data.opportunities[].closing string Expected closing date (format: MM-DD-YYYY)
data.opportunities[].opportunity_type string Opportunity type name
data.opportunities[].opportunity_type_id integer Opportunity type identifier
data.opportunities[].opportunity_sign string Currency / value sign used for the opportunity amount
data.opportunities[].value number Opportunity value / amount
data.opportunities[].prob integer Win probability percentage
data.opportunities[].derived number Derived value based on amount and probability
data.opportunities[].owner string Opportunity owner name
data.opportunities[].owner_id integer Opportunity owner identifier
data.opportunities[].latitude string Related contact latitude
data.opportunities[].longitude string Related contact longitude
data.opportunities[].custom_fields array Custom fields associated with the opportunity
data.opportunities[].custom_fields[].id integer Custom field identifier
data.opportunities[].custom_fields[].name string Custom field label
data.opportunities[].custom_fields[].position integer Display order position
data.opportunities[].custom_fields[].required boolean Whether the field is required
data.opportunities[].custom_fields[].custom_field_id integer Custom field identifier
data.opportunities[].custom_fields[].custom_field_inner_id integer Inner custom field identifier
data.opportunities[].custom_fields[].custom_field_type_id integer / string Custom field type identifier
data.opportunities[].custom_fields[].custom_field_option mixed Available options for option-based fields
data.opportunities[].custom_fields[].custom_field_option_default_id mixed Selected option identifier(s)
data.opportunities[].custom_fields[].value string Stored value for the custom field
data.opportunities[].linked_contacts array People linked to the opportunity
data.opportunities[].linked_contacts[].id integer Linked person identifier
data.opportunities[].linked_contacts[].name string Linked person name
data.opportunities[].linked_accounts array Accounts linked to the opportunity
data.opportunities[].linked_accounts[].id integer / string Linked account / contact identifier
data.opportunities[].linked_accounts[].name string Linked account / contact name
data.opportunities[].note string Opportunity notes
firstItemOnPage integer Index of the first item on the current page
hasNextPage boolean Whether another page of results is available
next_page_url string URL for the next page, when available
prev_page_url string URL for the previous page, when available
first_page_url string URL for the first page
last_page_url string URL for the last page
hasPreviousPage boolean Whether a previous page exists
isFirstPage boolean Whether the current page is the first page
isLastPage boolean Whether the current page is the last page
lastItemOnPage integer Index of the last item on the current page
pageCount integer Total number of pages
pageNumber integer Current page number
pageSize integer Number of items per page
totalItemCount integer Total number of matching opportunities
uri string Requested resource URI

Error Responses

Status Code Meaning
400 Bad Request – contact opportunities could not be retrieved successfully
401 Unauthorized – missing, invalid, or expired Bearer token
  • 400 – The service encountered an error while retrieving opportunities for the specified contact.
  • 401 – Authentication failed or the access token is missing/expired.