Opportunity Details

From docs
Jump to: navigation, search

Mobile_API »Get Opportunities

Base URL

https://apimobile.callproof.com

Endpoint

/api/opportunities

Purpose

Retrieves a paginated list of opportunities for the authenticated user’s company, with optional filters for date range, probability, markets/users, type, stage, contact type, and search text. Results include account details, stage/type, value, probability, owner, linked people/accounts, location, and custom fields.

HTTP Method

GET

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

Parameter Type Required Description
page integer No Page number for pagination (default: 1). Page size is 10
start_date string No Start of date range filter (used with end_date)
end_date string No End of date range filter (used with start_date)
pull_by integer No Date field to filter: 2 = created date; otherwise close date
start_probability integer No Minimum probability (0–100). Must be numeric between 0 and 100 when provided
end_probability integer No Maximum probability (0–100). Must be numeric between 0 and 100 when provided
sort_by integer No Sort by created date: 1 = ascending, 2 = descending (default also orders by ID descending)
markets string No Comma-separated market IDs used to filter opportunity owners
market_users string No Comma-separated user IDs used to filter opportunity owners
opportunity_type_id integer No Filter by opportunity type
stage_id integer No Filter by opportunity stage
contact_type_id integer No Filter by contact type of the associated account
search string No Search text applied to opportunity results

Request Body

None.

cURL Example for Android

 curl --location 'https://apimobile.callproof.com/api/opportunities?page=1&start_date=&end_date=&pull_by=&start_probability=&end_probability=&sort_by=&markets=&market_users=&opportunity_type_id=&stage_id=&contact_type_id=&search=' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' 

cURL Example for iOS

 curl --location 'https://apimobile.callproof.com/api/opportunities?page=1&start_date=&end_date=&pull_by=&start_probability=&end_probability=&sort_by=&markets=&market_users=&opportunity_type_id=&stage_id=&contact_type_id=&search=' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' 

Successful Response (200)

Returns a paginated list of opportunities.

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 Opportunities payload
firstItemOnPage integer Index of the first item on the current page
lastItemOnPage integer Index of the last item on the current page
hasNextPage boolean Whether a next page is available
hasPreviousPage boolean Whether a previous page is available
isFirstPage boolean Whether the current page is the first page
isLastPage boolean Whether the current page is the last page
next_page_url string/null URL of the next page, when available
prev_page_url string/null URL of the previous page, when available
first_page_url string URL of the first page
last_page_url string URL of the last page
pageCount integer Total number of pages
pageNumber integer Current page number
pageSize integer Number of items per page (10)
totalItemCount integer Total number of matching opportunities
uri string Requested resource URI

data.opportunities[]

Field Type Description
opportunity_id integer Unique identifier of the opportunity
contact_id integer Associated contact/account ID
associated_account_name string Company/account name
contact_type_id integer/string Contact type identifier
contact_type string Contact type name
name string Opportunity name
stage string Opportunity stage name
stage_id integer Opportunity stage identifier
closing string Close date (format: m-d-Y)
opportunity_type string Opportunity type name
opportunity_type_id integer Opportunity type identifier
opportunity_sign string Currency/sign used for opportunity value
value number Opportunity value
prob integer/number Probability percentage
derived number Derived value (value × probability / 100)
owner string Opportunity owner name
owner_id integer Opportunity owner user ID
latitude string/number Contact latitude
longitude string/number Contact longitude
linked_contacts array People linked to the opportunity (id, name)
linked_accounts array Accounts linked to the opportunity (id, name)
custom_fields array Opportunity custom field values
note string Opportunity notes

Error Responses

Status Code Meaning
200 Validation failed – response body uses clientStatusCode 401 with the first validation error message
400 Bad Request – opportunities could not be retrieved
401 Unauthorized – missing, invalid, or expired Bearer token
  • Validation (HTTP 200, clientStatusCode 401) – Invalid start_probability or end_probability (must be numeric between 0 and 100).
  • 400 – An error occurred while retrieving opportunities (for example, "Error while retrieving the Contact Opportunities").
  • 401 – Authentication failed or the access token is missing/expired.