Opportunity Details Filter

From docs
Jump to: navigation, search

Mobile_API » Get User Opportunities

Base URL

https://apimobile.callproof.com

Endpoint

/api/opportunities/user/{user_id}

Purpose

Retrieves a paginated list of opportunities scoped to a specific user (and market/user filter rules). Supports filtering by date range, probability, stage, type, contact type, markets, and search text.

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
user_id integer Yes User whose opportunities should be retrieved (used when market filters are empty/false)

Query Parameters

Parameter Type Required Description
page integer No Page number for pagination (default: 1). Page size is 10
search string No Search text for opportunity matching
start_date string No Start of date range filter
end_date string No End of date range filter
pull_by integer No Date field used for range filter: default close date; 2 uses created date
start_probability numeric No Minimum probability (0–100)
end_probability numeric No Maximum probability (0–100)
sort_by integer No Sort by created date: 1 ascending, 2 descending
opportunity_type_id integer No Filter by opportunity type
stage_id integer No Filter by opportunity stage
contact_type_id integer No Filter by related contact type
markets string No Comma-separated market IDs
market_users string No Comma-separated market user IDs

Request Body

None.

cURL Example for Android

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

cURL Example for iOS

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

Successful Response (200)

Returns a paginated opportunities 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 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 Related contact identifier
associated_account_name string Related account/company name
contact_type_id integer/string Related contact type identifier
contact_type string Related 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 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 Related contact latitude
longitude string/number Related contact longitude
linked_contacts array Linked people (id, name)
linked_accounts array Linked accounts (id, name)
custom_fields array Opportunity custom fields and 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 / 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.