NetSuite RESTlets Events

Cloud Elements supports events via polling or webhooks depending on the API provider. For more information about our Events framework, see Events Overview.

Supported Events and Resources

Cloud Elements supports polling events for NetSuite RESTlets. After receiving an event, Cloud Elements standardizes the payload and sends an event to the configured callback URL of your authenticated element instance.

You can set up polling for the events resource. You can also copy the events configuration to poll other resources. See Configure Polling Through API for more information.

Note: Unless configured for a specific time zone, polling occurs in UTC.

Configure Polling Through the UI

To configure polling through the UI, follow the same steps to authenticate an element instance, and then turn on events. Select the resources to poll, and then click Create Instance. For more information, see Authenticate an Element Instance with Events (UI) or the element-specific authentication topic.

Configure Polling Through API

To authenticate an element instance with polling, sign in to Cloud Elements, and then create a new element instance as described in NetSuite RESTlets API Provider Setup. When using the API, there are additional parameters used to enable and configure polling events on the new instance.

Example JSON with Polling

This example JSON shows the parameters that can be sent to the /instances API to enable and configure polling. The example shows how to configure polling for Customers objects, but you can set whichever types of objects that you wish.

{
  "element":{
    "key": "netsuiterestlets"
  },
  "configuration": {
    "event.vendor.type": "polling",
    "event.poller.refresh_interval":"1",
    "event.notification.enabled": "false"
   },
    "account-id":"xxxxxxxxx",
    "consumer-key":"xxxxxxxxxxxxxx",
    "consumer-secret":"xxxxxxxxxxxxxxxx",
    "deploymentId":"xxxx",
    "event.notification.enabled":"false",
    "event.poller.configuration": {
      "customers": {
        "url": "/hubs/erp/customers?where=lastModifiedDate>'${gmtDate:yyyy-MM-dd'T'HH:mm:ss'Z'}'",
        "idField": "internalId",
        "datesConfiguration": {
          "updatedDateField": "lastModifiedDate",
          "updatedDateFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'",
          "updatedDateTimezone":"GMT",
          "createdDateField": "dateCreated",
          "createdDateFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'",
          "createdDateTimezone":"GMT"
        }
      }
    },
     "event.poller.refresher_interval":"1",
     "event.vendor.type":"polling",
     "scriptId":"xxx",
     "token-Id":"xxxxxxxxxxxxxxxxxxxx",
     "token-secret":"xxxxxxxxxxxxxxxx",
"tags": [
    "xxxxxxx"
  ],
  "name": "NetSuite xxxxxxxx"
}

Parameters

Note: Non-event related parameters are described in Authenticate an Element Instance
ParameterDescriptionData Type
Events Enabled
event.notification.enabled
Optional. Identifies that events are enabled for the element instance.
Default: false.
boolean
Event Notification Callback URL
event.notification.callback.url
The URL where you want Cloud Elements to send the events.string
Event Poller Refresh Interval
event.poller.refresh_interval
A number in minutes to identify how often the poller should check for changes.number
Configure Polling
event.poller.configuration
Optional. Configuration parameters for polling.JSON object
urlThe url to query for updates to the resource.String
idFieldThe field in the resource that is used to uniquely identify it.String
datesConfigurationConfiguration parameters for dates in pollingJSON Object.
updatedDateFieldThe field that identifies an updated object.String
updatedDateFormatThe date format of the field that identifies an updated object.String
createdDateFieldThe field that identifies a created object.String
createdDateFormatThe date format of the field that identifies a created object.String