irritable
Iterable API request wrapper for client && node.js
Install
$ npm install irritable --save
Usage
// Send event to Iterablevar token = processenvITERABLE_TOKENvar Irritable = token: token //API Token IrritableEvents
TODO
- Add events
- Add Lists
- Add users
- Add push
- Add sms
- Add campaigns
- Add commerce
- Add email
- Add export
- Add workflows
API
irritable(options)
-> object
options
token
Required
Type: string
or process.env.ITERABLE_TOKEN
Token / key used to communicate with Iterable API
baseURL
Optional
Type: string
Default: http://api.iterable.com/api/
Base URL of iterable api.
timeout
Optional
Type: number
Default: 3000 ms
Timeout of request life sent to iterable
responseType
Optional
Type: string
Default: json
Response type sent back from iterable
irritable.Events
-> object
returns event handler object:
track: <fn> trackPushOpen: <fn> trackConversion: <fn>
irritable.Events.track(eventObject)
-> promise
Sends a validated event object to Iterable.
eventObject
optional
Type: string
Email associated with the event.
eventName
required
Type: string
eventName associated with the event.
createdAt
optional
Type: string
date / unix timestamp of the associated event.
dataFields
optional
Type: object
Metadata for the event.
campaignId
optional
Type: number
campaignId of the event.
templateId
optional
Type: number
templateId of the event.
irritable.Events.trackConversion(eventObject)
-> promise
Sends a validated trackConversion event object to Iterable.
eventObject
required
Type: string
Email associated with the event.
campaignId
required
Type: number
campaignId of the event.
createdAt
optional
Type: string
date / unix timestamp of the associated event.
dataFields
optional
Type: object
Metadata for the event.
templateId
optional
Type: number
templateId of the event.
irritable.Events.trackPushOpen(eventObject)
-> promise
Sends a validated trackPushOpen event object to Iterable.
eventObject
required
Type: string
Email associated with the event.
userId
required
Type: string
UserId associated with the event.
campaignId
required
Type: number
campaignId of the event.
createdAt
optional
Type: string
date / unix timestamp of the associated event.
dataFields
optional
Type: object
Metadata for the event.
templateId
optional
Type: number
templateId of the event.