Get Activities of an Opportunity

Returns the activities of an opportunity. There are 2 ways to use this API –

Notes:

  • This API will retrieve the details of up to 25 activities in a single call. If you want to retrieve more than 25 activities you must pass the pagination parameters.
    For example, {“Paging”: {“Offset”: “1”,”RowCount”: “50”}}
  • To get theOpportunityIdof an opportunity, use the Get an Opportunity by Id API.

 

API URL

POST
https://{host}/v2/OpportunityManagement.svc/GetActivitiesOfOpportunity?accessKey=AccessKey&secretKey=SecretKey&opportunityId=OpportunityId&activityEventCode=ActivityEventCode
Copy URL

URL Parameters

Parameter Description
OpportunityId The opportunity Id for the opportunity type. This is mandatory.
ActivityEventCode The activity event code for the activity type. This is optional.

Request

JSON Body/Payload

Content-Type: application/json

{
   "Columns":{
      "Include_CSV":"CreatedOn,Status"
   },
   "Paging":{
      "PageIndex":1,
      "PageSize":100
   },
   "Sorting":{
      "ColumnName":"LeadOwner"
   }
}

JSON Properties

Parameter Description
Columns

By default, all the standard activity fields are returned. InInclude_CSV, add the specific activity fields you want to retrieve in the response.

Paging

The results matching your criteria may be large. You can fetch the result in blocks of “PageSize” and make multiple calls to the API with increasing values of “PageIndex”. For example, you can specify “PageIndex”: 1, “PageSize”: 100 for the first call and specify “PageIndex”: 2, “PageSize”: 100 for second call.

Sorting

Pass the ColumnName by which you want to sort the results.

For direction, passing ‘1’ will sort the data by the most recent first. Passing ‘0’ will sort the data by the oldest first.

Response

200 OK

Content-Type: application/json

{
   "RecordCount":1,
   "List":[
      {
         "ProspectId":"69e1c27e-dd08-4b53-b509-f353ad1c7f4d",
         "FirstName":"Manish",
         "LastName":"Garg",
         "EmailAddress":"manish@mailinator.com",
         "Phone":"+91-9999999999",
         "DoNotCall":"0",
         "DoNotEmail":"0",
         "LeadName":"Manish Garg",
         "LeadOwner":"Rohan Sane",
         "ProspectActivityId":"4ff82538-3e7c-4bc2-ab0d-81957e91865c",
         "ActivityType":"2",
         "ActivityEvent":"168",
         "Score":"0",
         "PACreatedOn":"2020-10-16 05:57:37",
         "PAModifiedOn":"2020-10-16 06:10:54",
         "ActivityEvent_Note":null,
         "IP_Latitude":null,
         "IP_Longitude":null,
         "PACreatedByName":"Rajesh Aggarwal",
         "Status":null,
         "O_ProspectActivityId":"",
         "Total":"1",
         "O_ActivityEventName":"",
         "O_ActivityEvent":"",
         "O_mx_Custom_1":"",
         "O_Status":"",
         "O_Owner":""
      }
   ]
}

HTTP Response Code

Code Description
200 OK

This is the status code for successful API call.

401 Unauthorized

The API call was made with invalid access credentials. Check your AccessKey and SecretKey.

400 Bad Request

The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure.

404 Not Found

The API could not be found. Please check the API signature.

429 Too Many Requests

API calls exceeded the limit of 25 in 5 second(s)

500 Internal Server Error

The API called failed. There could be many reasons for it. Check the exception message to get more details.