When you create a Salesforce opportunity with a contact role that’s associated with a Account Engagement prospect, we create a read-only opportunity in Account Engagement. To use Account Engagement opportunities, first set up the Account Engagement-Salesforce connector. Learn more about opportunities in Salesforce Help.
Include the authentication header with every request. For information on how to authenticate, see Authentication.
Replace <prospect_id> with the prospect’s Account Engagement ID.
Parameters
You can use the following parameters when creating an opportunity.
Parameter
Type
Possible Values
Description
name
string
Any string
The name of the opportunity.
value
integer
Any integer
The opportunity’s value.
probability
integer
Any integer from 0 through 100
The probability of winning the opportunity.
prospect_email
string
The prospect’s email address.
If you’re creating the opportunity by prospect ID, you can also include the prospect’s email address. If both prospect_email and prospect_id are specified, both must correspond to the same prospect. Otherwise, the API will return an error.
prospect_id
integer
Any valid prospect ID.
If you’re creating the opportunity by prospect email, you can also include the prospect’s ID. If both prospect_email and prospect_id are specified, both must correspond to the same prospect. Otherwise, the API will return an error.
Example
Use a prospect’s email address to create an opportunity with the name “Large Customer Opportunity”, a value of 100, a probability of 70%. The prospect’s email address is jdoe@company.com.
Delete the specified opportunity. This request doesn’t delete the visitor activities or score changes for the prospect who is associated with the opportunity.
If this request is successful, it doesn’t return a response.
URI
1/api/opportunity/version/3/do/delete/id/<ID>?...
Replace <ID> with the Account Engagement ID of the opportunity.
Example
Delete the opportunity with Account Engagement ID 1234.
1/api/opportunity/version/3/do/delete/id/1234
Opportunity Read
Request information for a single opportunity.
URI
1/api/opportunity/version/3/do/read/id/<ID>?..
Replace <ID> with the Account Engagement ID of the opportunity.
Example
Request information for the opportunity with Account Engagement ID 1234.
1/api/opportunity/version/3/do/read/id/1234
Opportunity Query
Request information about the opportunities that match the specified criteria. You can specify which opportunities and which fields to request. A maximum of 200 opportunities are returned, unless you specify the output as mobile. If you specify the output as mobile, then all opportunities are returned.
Note: To request information about a specific opportunity, use Opportunity Read.
URI
1/api/opportunity/version/3/do/query?...
Parameters to Select Opportunities
Use these parameters to specify which opportunities are returned. Parameters can be used in any combination and in any order unless otherwise specified.
Request opportunities created after the specified date and time. Example: To request forms created in 2020, use /api/opportunities/version/3/do/query?created_after=2019-12-31 24:59:59.
Request opportunities created before the specified date and time. Doesn’t include opportunities created at the specified time. <custom_time>Example: to request opportunities created before today (but not created today), use /api/opportunity/version/3/do/query?created_before=today.
id_greater_than
integer
Any positive integer
Request opportunities that have an Account Engagement ID greater than the specified number.
id_less_than
integer
Any positive integer
Request opportunities that have an Account Engagement ID less than the specified number.
probability_greater_than
integer
Any integer from 1 through 100
Request opportunities that have a probability greater than the specified number.
probability_less_than
integer
Any integer from 1 through 100
Request opportunities that have a probability less than the specified number.
prospect_email
string
Any valid prospect email
Request opportunities associated with the prospect having the specified email. Note: If you specify a prospect’s email and a prospect’s ID, ensure the email and ID belong to the same prospect. Otherwise, the request returns an error.
prospect_id
integer
Any valid prospect ID
Request opportunities associated with the prospect having the specified ID. Note: If you specify a prospect’s email and a prospect’s ID, ensure the email and ID belong to the same prospect. Otherwise, the request returns an error.
value_greater_than
integer
Any integer
Request opportunities that have a value greater than the specified number.
value_less_than
integer
Any integer
Request opportunities that have a value less than the specified number.
Parameters to Specify Which Results Are Returned
Use these parameters to specify which opportunity fields are returned, and how the opportunities are sorted.
Parameter
Type
Possible Values
Description
limit
integer
Any integer from 1 through 200.
The number of opportunities to return. Default value is 200.
offset
integer
Any positive integer
The number of opportunities to omit from the response (the number to “skip over”). Example: Retrieve a list of opportunities, omitting the 50 most recently updated opportunities. Sort the query by the probability field and use offset=50: /api/opportunity/version/3/do/query?offset=50&sort_by=probability
output
string
simple, mobile, full
Specify the level of detail in the XML response. For more information, see XML Response Format.
sort_by
string
created_at, id, probability, value
The field by which the results are sorted. See Sort Order.
sort_order
string
ascending, descending
The sort order. The default value depends on which sort_by value you specify. See Sort Order.
Sort Order
Use sort_by to specify which field Account Engagement uses to sort the results. Different fields have different default sort orders.
Value
Default Sort Order
Description
created_at
descending
Sort the results by the opportunities’ created_at timestamps.
id
ascending
Sort the results by the opportunities’ id fields.
probability
descending
Sort the results by the opportunities’ probability fields.
value
descending
Sort the results by the opportunities’ value fields.
Request a list of opportunities, sorted in ascending order by probability.
The XML response for a query request contains information about multiple opportunities. The XML response for a read request contains information about a single opportunity.
Parent tag. Contains the opportunities that match the parameters specified in your query.
<total_results>
The number of opportunities selected by the query. Note: The query request returns a maximum of 200 opportunities. If your query matches more than 200 opportunities, you can make several requests to retrieve all matching records.
<opportunity>
The information for a single opportunity. For information about opportunity fields, see Opportunity.