Capture Opportunities Status API
Returns the status of the opportunity capture request.
- Pass the
x-api-keyin the header, see Async API. - Pass the
RequestIdparameter returned by the Capture Opportunities (Async) API, in the query string.
Note: To get metrics for the Capture Opportunities (Async) API, see Get Capture Opportunities Metrics API.
The response JSON contains the following parameters –
| Parameter |
Description | Type | |
| RequestId | ID of the request. | String | |
| TaskStatus | Top-level parameter. Contains details of the task status. | Object | |
| TaskType | The task type related to the request. For example, “Lead Capture”. | String | |
| Status | Returned values are “In-Queue”, “FAILURE”, “ERROR”, “Success”. | String | |
| StatusReason | Text explaining the reason for the above status. If “Success”, then “Request was successfully completed” is returned; otherwise, error reason is returned. | String | |
| TaskCurrentStep | Current step the request is in. | Enum | |
| TaskLastStep | Previous step the request completed. | Enum | |
| RequestBody | The body that was passed in the Async API request. | Object | |
| Message | If successful, response data for the original API request is returned; otherwise null is returned. | Object | |
API URL
URL Parameters
| Parameter | Description |
|---|---|
| RequestID | Id of the request returned by the Capture Opportunities (Async) API. |
Response
{
"RequestId":"c1d867a7-a325-4b68-954f-237dcd3c15e1",
"TaskStatus":{
"TaskType":"Opportunity Capture",
"Status":"Success",
"StatusReason":"Request was successfully completed",
"TaskCurrentStep":null,
"TaskLastStep":"In-Process-Queue",
"RequestBody":"{\r\n \"LeadDetails\": [\r\n {\r\n \"Attribute\": \"EmailAddress\",\r\n \"Value\": \"jhon.smith@leadsquared.com\"\r\n },\r\n {\r\n \"Attribute\": \"mx_City\",\r\n \"Value\": \"Delhi\"\r\n },\r\n \r\n {\r\n\t\t\t\"Attribute\": \"SearchBy\",\r\n\t\t\t\"Value\": \"EmailAddress\"\r\n\t\t}\r\n ],\r\n \"Opportunity\": {\r\n\r\n \"OpportunityEventCode\": 363,\r\n\t\"OpportunityNote\": \"Car insurance loan\",\r\n\t\"OpportunityDateTime\": \"2020-10-12 16:52:59\",\r\n \"Fields\": [\r\n \t{\r\n \"SchemaName\": \"mx_Custom_1\",\r\n \"Value\": \"Car insurance\"\r\n },\r\n\t\r\n \r\n {\r\n \"SchemaName\": \"mx_Custom_6\",\r\n \"Value\": \"100000\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_8\",\r\n \"Value\": \"2020-05-04 12:13:44\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_11\",\r\n \"Value\": \"Advertisment\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_3\",\r\n \"Value\": \"Success\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_13\",\r\n \"Value\": \"two\"\r\n },\r\n {\r\n \"SchemaName\": \"Status\",\r\n \"Value\": \"Won\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_2\",\r\n \"Value\": \"Jhon\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_19\",\r\n \"Value\": \"two\"\r\n },\r\n {\r\n \"SchemaName\": \"mx_Custom_5\",\r\n \"Value\": \"Veriied user\"\r\n }\r\n ]\r\n }\r\n \t\r\n}",
"Message":"{\"AdditionalDetails\":[{\"ActivityId\":\"ec2b45cc-bac8-4e5b-9230-69f26ea7b034\",\"PostDeDupActionPerformed\":1}],\"ConflictedOpportunityId\":null,\"CreatedOpportunityId\":\"0722f894-64e3-4162-bf84-480017bbc9f1\",\"ExceptionMessage\":null,\"ExceptionType\":null,\"IsUnique\":true,\"PrimaryAction\":1,\"RelatedProspectId\":\"e7b8c25f-0bfa-4213-adde-78e8cfcc3e88\",\"RequestId\":\"c49a045b-6081-48d3-ada8-36501f856ea3\",\"SecondaryAction\":2,\"Status\":0}"
}
}
HTTP Response Codes
| 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. |

