Sync Accounts

Despite its name, this API method does not actually synchronize any data. It will not update account data.

This method allows you to query the server to find out whether an account has been updated. This saves you from iterating through accounts 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 account ID.

Date Range

Using the syncAccountTimeFrom and syncAccountTimeTo parameters, you can ask the server to provide a list of all accounts 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 syncAccounts request using a date range starting a week ago and ending with the current date.

Account ID

Using the accountIds.accountId parameter, you can ask the server for the last update time/date of a specific account.

Account IDs within a Date Range

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

What triggers a change in the Account Last Modified timestamp?

  • Creating a new account
  • Editing the account details from UI
  • Updating the account from the API
  • The creation or editing of a transaction or activity associated with an account does not update this timestamp.

REST

Request

http://api.neoncrm.com/neonws/services/api/account/syncAccounts?userSessionId=[session id]&syncAccountTimeFrom=2014-01-10T15:50:28.153+08:00

Response

{
    "syncAccountsResponse": {
        "operationResult": "SUCCESS",
        "responseDateTime": "2014-04-10T15:54:38.506+08:00",
        "individualAccounts": {
            "individualAccount": [
                {
                    "lastModifiedDateTime": "2014-05-07T00:00:00.000+08:00",
                    "lastModifiedBy": "Lee Owens",
                    "accountId": 126240,
                    "primaryContact": {
                        "contactId": 127891,
                        "firstName": "Eagan",
                        "lastName": "Boyd",
                        "middleName": "",
                        "fax": "149 940-0768",
                        "gender": {
                            "code": "F",
                            "name": "Female"
                        },
                        "deceased": false,
                        "addresses": {
                            "address": [
                                {
                                    "addressId": 76325,
                                    "isPrimaryAddress": true,
                                    "isShippingAddress": false,
                                    "addressLine1": "507-8144 Enim Ave",
                                    "city": "Akron",
                                    "province": "",
                                    "country": {
                                        "id": "102",
                                        "name": "Iraq"
                                    },
                                    "zipCode": "05448"
                                }
                            ]
                        }
                    },
                    "noSolicitation": false,
                    "customFieldDataList": {
                        "customFieldData": []
                    },
                    "source": {},
                    "individualTypes": {
                        "individualType": []
                    }
                },
                {
                    "lastModifiedDateTime": "2014-05-01T00:00:00.000+08:00",
                    "lastModifiedBy": "Chester Hooper",
                    "accountId": 126213,
                    "primaryContact": {
                        "contactId": 127864,
                        "firstName": "Timothy",
                        "lastName": "Parker",
                        "middleName": "",
                        "fax": "558 637-6154",
                        "gender": {
                            "code": "F",
                            "name": "Female"
                        },
                        "deceased": false,
                        "addresses": {
                            "address": [
                                {
                                    "addressId": 76298,
                                    "isPrimaryAddress": true,
                                    "isShippingAddress": false,
                                    "addressLine1": "368-9728 Ultrices Ave",
                                    "city": "Darlington",
                                    "province": "",
                                    "country": {
                                        "id": "117",
                                        "name": "Lebanon"
                                    },
                                    "zipCode": "65474"
                                }
                            ]
                        }
                    },
                    "noSolicitation": false,
                    "customFieldDataList": {
                        "customFieldData": []
                    },
                    "source": {},
                    "individualTypes": {
                        "individualType": []
                    }
                }
            ]
        },
        "organizationAccounts": {
            "organizationAccount": []
        },
        "deletedAccountList": {
            "accountId": []
        },
        "page": {
            "currentPage": 1,
            "pageSize": 10,
            "totalPage": 1,
            "totalResults": 2
        }
    }
}

Request Parameters

Name Required Description
accountIds.accountId Specific Account IDs to query. This parameter is required if syncAccountTimeFrom is not included. To query more than one account ID, repeat this parameter.
syncAccountTimeFrom This parameter is required if accountIds.accountId is not included. Beginning of the date range. Use format: 2014-01-10T15:50:28.153+08:00
syncAccountTimeTo End of the date range. Use format: 2014-01-10T15:50:28.153+08:00
ignoreDeletedIdList Specify whether the response should include accounts that have been deleted. Possible values: true, false.
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 (see response parameters for options).
page.sortDirection Possible values: ASC, DESC.

Response Parameters

Name Required Description
individualAccounts Any individual accounts that match the request criteria.
organizationAccounts Any organization accounts that match the request criteria.
deletedAccountList A list of IDs of accounts that match the request criteria and were deleted.
page.currentPage
page.pageSize
page.totalPage
page.totalResults
page.sortColumn
page.sortDirection

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.