Get Activities by Date Range

Lets you retrieve all activities within a given time frame. The FromDate and ToDate must be specified in yyyy-mm-dd hh:mm:ss format.

Note: The time zone considered is Universal Time Coordinated (UTC). You may need to convert the time from your local timezone to UTC before passing it here.

API URL

POST
https://{host}/v2/ProspectActivity.svc/RetrieveRecentlyModified?accessKey=AccessKey&secretKey=SecretKey
Copy URL

Request

JSON Body/Payload

Content-Type: application/json

{
    "Parameter": {
        "FromDate": "2017-01-01 00:00:00",
        "ToDate": "2017-01-17 23:59:59"
    },
    "Paging": {
        "PageIndex": 1,
        "PageSize": 20
    },
    "Sorting": {
        "ColumnName": "CreatedOn",
        "Direction": 1
    }
}

JSON Properties

Parameter Description
FromDate

Beginning of the date range

ToDate

End of the date range

PageIndex

The results set 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 the second call.

PageSize

The results set 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 the second call.

ColumnName

The column on which results will be sorted. For example, if you want results to be shown based on creation date, pass “CreatedOn”.

Direction

Direction “1” means descending order and “0” means ascending order.

Response

200 OK

Content-Type: application/json

{
    "RecordCount": 2,
    "ProspectActivities": [
        {
            "Id": "7bbffcd2-de66-11e7-9f0f-0236dfe9c25a",
            "EventCode": 10,
            "EventName": "Email Bounced",
            "ActivityScore": -10,
            "CreatedOn": "2017-12-11 11:27:49",
            "ActivityType": 0,
            "IsEmailType": true,
            "Type": "Inbound",
            "EmailType": "Automation Email",
            "SessionId": "7bbffcd2-de66-11e7-9f0f-0236dfe9c25a",
            "TrackLocation": 0,
            "Latitude": 0,
            "Longitude": 0,
            "RelatedProspectId": "afdb17d8-86c7-4bfe-a873-ffaf304dd1dd",
            "Data": [
                {
                    "Key": "BounceReason",
                    "Value": "Notified Rejected(Invalid) by EmailServiceProvider at 2017-12-11 11:27:49(UTC) for Email: Welcome to One FC"
                },
                {
                    "Key": "EmailCampaignName",
                    "Value": "Welcome to One FC"
                },
                {
                    "Key": "EmailCampaignId",
                    "Value": "f0b48ef1-8f07-11e7-b0ab-02e89b2fb8f4"
                },
                {
                    "Key": "Subject",
                    "Value": "Welcome to One FC"
                }
            ]
        },
        {
            "Id": "2492e463-d01d-4f79-a279-cd36434485ad",
            "EventCode": 2001,
            "EventName": "EmailSent",
            "ActivityScore": 0,
            "CreatedOn": "2017-12-11 11:27:49",
            "ActivityType": 25,
            "IsEmailType": true,
            "Type": "Outbound",
            "EmailType": "Automation Email",
            "SessionId": "484b7b31-f05a-11e7-a4f2-020714094d7e",
            "TrackLocation": 0,
            "Latitude": 0,
            "Longitude": 0,
            "RelatedProspectId": "afdb17d8-86c7-4bfe-a873-ffaf304dd1dd",
            "Data": [
                {
                    "Key": "FullName",
                    "Value": ""
                },
                {
                    "Key": "EmailAddress",
                    "Value": ""
                },
                {
                    "Key": "Subject",
                    "Value": "Welcome to One FC"
                },
                {
                    "Key": "FromUserName",
                    "Value": "Vir Singh"
                }
            ],
            "Address": "",
            "City": "",
            "State": "",
            "Country": ""
        }
    ]
}

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.