Sync Activities

Despite its name, this API method does not actually synchronize any data. It will not update activity data. This method allows you to query the server to find out whether an activity has been updated. This saves you from iterating through activities individually based on their last modified date. Instead, you can query the server for updates using one of two approaches: by date range or by activity ID.

Date Range

Using the syncActivityTimeFrom and syncActivityTimeTo parameters, you can ask the server to provide a list of all activitys that have been updated within the date range you specify.

Example: You want to synchronize the data between NeonCRM and another system on a weekly basis. Every week, run the syncActivities request using a date range starting a week ago and ending with the current date.

Activity ID

Using the activityIds.activityId parameter, you can ask the server for the last update time/date of a specific activity.

Activity IDs within a Date Range

You can use a combination of both parameters to query a specific set of activities within a specific date range.

What triggers a change in the Activity Last Modified timestamp?

  • Creating a new activity
  • Editing the activity details from UI
  • Updating the activity from the API

REST

Request

https://api.neoncrm.com/neonws/services/api/account/syncActivities?userSessionId=T1397187872133&syncActivityTimeFrom=2014-01-11T11:44:37.048+08:00&activityIds.activityId=653&activityIds.activityId=652

Response

{
    "syncActivitiesResponse": {
        "operationResult": "SUCCESS",
        "responseDateTime": "2014-04-11T11:45:32.855+08:00",
        "activities": {
            "activity": [
                {
                    "createdDateTime": "2013-07-09T15:53:19.000+08:00",
                    "createdBy": "Colin Pizarek",
                    "lastModifiedDateTime": "2014-04-09T03:26:06.000+08:00",
                    "activityId": 653,
                    "subject": "ddddd",
                    "note": "",
                    "startDateTime": "2014-04-08T11:00:00.000-05:00",
                    "endDateTime": "2014-03-31T11:00:00.000-05:00",
                    "systemUserId": 101132,
                    "activityStatus": {
                        "id": "2",
                        "name": "Not Started"
                    },
                    "activityPriority": "NORMAL"
                },
                {
                    "createdDateTime": "2013-07-09T15:53:19.000+08:00",
                    "createdBy": "Colin Pizarek",
                    "lastModifiedDateTime": "2014-03-09T20:15:14.000+08:00",
                    "activityId": 652,
                    "subject": "ddddd",
                    "note": "",
                    "startDateTime": "2014-03-08T11:00:00.000-05:00",
                    "endDateTime": "2014-02-28T11:00:00.000-05:00",
                    "systemUserId": 101132,
                    "activityStatus": {
                        "id": "2",
                        "name": "Not Started"
                    },
                    "activityPriority": "NORMAL"
                }
            ]
        },
        "page": {
            "currentPage": 1,
            "pageSize": 10,
            "totalPage": 1,
            "totalResults": 2
        },
        "deletedActivityIdList": {
            "activityId": []
        }
    }
}

Request Parameters

Name Required Description
activityIds.activityId Yes * Specific Activity IDs to query. This parameter is required if syncActivityTimeFrom is not included.
syncActivityTimeFrom Yes * This parameter is required if activityIds.activityId is not included. Beginning of the date range. Use format: 2014-01-10T15:50:28.153+08:00
syncActivityTimeTo End of the date range. Use format: 2014-01-10T15:50:28.153+08:00
ignoreDeletedIdList Specify whether deleted activities are included in the response.
page.currentPage Request a specific page of results.
page.pageSize Specify the number of results in this page.
page.sortColumn Sort results by the specified column.
page.sortDirection ASC or DESC

Response Parameters

Name Required Description
activities Yes Any activities that match the request criteria.
deletedActivityIdList A list of IDs of activities that match the request criteria and were deleted.
page.currentPage Yes Current page of results
page.pageSize Yes Number of results per page
page.totalPage Yes Total number of pages of results
page.totalResults Yes Total number of results
page.sortColumn Column by which results are sorted
page.sortDirection ASC or DESC

Error Codes

Code Text Description
10240 Synchronized “from” date cannot be after synchronized “to” date. The beginning date in your range occurs after your end date. Unless you’ve invented a time machine, this is impossible.
10242 Date range or activity id is required.