Retrieve Opportunity List by Contact ID

From docs
Jump to: navigation, search

Retrieve Opportunity by Contact ID

Base URL

https://apimobile.callproof.com

Endpoint

/api/contacts/{id}/opportunities/{opportunity_id}

Purpose

Returns the details of a single sales opportunity that belongs to a specific contact. The response includes opportunity name, stage, type, value, probability, owner, closing date, linked people and accounts, custom fields, and notes so users can review or edit that opportunity in context of the contact.

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 associated with the opportunity
opportunity_id integer Yes Unique identifier of the opportunity to retrieve

Query Parameters

None.

Request Body

None.


cURL Example for Android

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

cURL Example for iOS

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

Successful Response (200)

Indicates that the opportunity was retrieved successfully for the specified contact. If no matching opportunity is found for that contact, data.opportunities is returned as an empty list.

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 payload
data.opportunities object / array Opportunity details when found; empty array when not found
data.opportunities.opportunity_id integer Unique opportunity identifier
data.opportunities.contact_id integer Related contact identifier
data.opportunities.contact_name string Company / account name of the related contact
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.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_table_id integer / string Custom field table 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 Linked account / contact identifier
data.opportunities.linked_accounts[].name string Linked account / contact name
data.opportunities.note string Opportunity notes
uri string Requested resource URI

Error Responses

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