New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-iterable-api

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-iterable-api

Wrapper for Iterable API

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Node Iterable API

JavaScript Style Guide Build Status Coverage Status npm version Known Vulnerabilities

Credit: seanmcgary/iterable

Install

npm install node-iterable-api

Example

const Iterable = require('node-iterable-api')

const client = new Iterable('<iterable api key>')

return client.lists().get()
  .then(lists => {
    console.log(lists.lists)
  })
  .catch(err => {
    console.log(err)
  })

Resources

All resources are taken from those available in the Iterable API documentation.

Note: Not all resources are implemented yet. You can see which ones in lib/api.js.

Resources are addressable by calling:

// If param is a string, it'll append it to the resource path
// Otherwise you can just past an object that will either be
// passed to the body on a POST/PUT request, or as query
// string params in the case of a GET request
iterableInstance[<resource name>]()[<resource action>](param[, payload])

// e.g. to get lists:
iterableInstace.lists().get()
  .then(data => {
	// data response
  })

// e.g. bulk update users
iterableInstace.users().bulkUpdate({
	users: {
		email: 'foo@bar.com',
		dataFields: {
			// some data fields
		},
		userId: "someUserId"
	}
})

Actions and resources are as follows:

lists
	GET    - /lists
	POST   - /lists
	DELETE - /lists/{listId}
	GET    - /lists/getUsers?listId={listId}
	POST   - /lists/subscribe
	POST   - /lists/unsubscribe
	
events
	POST   - /events/track
	POST   - /events/trackBulk
    GET    - /events/{email}
    POST   - /events/trackInAppOpen
    POST   - /events/trackInAppClick
    POST   - /events/trackWebPushClick
    POST   - /events/trackConversion
    POST   - /events/trackPushOpen
	
users
	GET    - /users/{email}
	DELETE - /users/{email}
	POST   - /users/update
	POST   - /users/updateEmail
	POST   - /users/bulkUpdate
	POST   - /users/registerDeviceToken
	POST   - /users/updateSubscriptions
	GET    - /users/getByEmail/{email}
	GET    - /users/byUserId/{userId}
	DELETE - /users/byUserId/{userId}
	GET    - /users/getFields
	GET    - /users/getSentMessages
	POST   - /users/disableDevice

email
    GET    - /email/viewInBrowsers?email={email}&messageId={messageId}
    POST   - /email/target

webPush
    POST   - /webPush/target
    
inApp
    GET    - /inApp/getMessages?email={email}&count={msgCount}
    GET    - /inApp/getMessages?userId={userId}&count={msgCount}
    
push
	POST   - /push/target
	
campaigns
	POST   - /campaigns/create

commerce
	POST   - /commerce/trackPurchase
	POST   - /commerce/updateCart
	
email
	GET    - /email/viewInBrowser
	POST   - /email/target
	
workflows
	POST   - /workflows/triggerWorkflow
	
sms
    POST   - /sms/target
    
messageTypes
    GET    - /messageTypes
    
experiments
    GET    - /experiments/metrics

Development

To run the full tests with coverage:

npm test

To run test driven development:

npm run tdd

Keywords

FAQs

Package last updated on 15 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc