1.2.0 • Published 3 years ago

mds-carrotquest-client v1.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

mds-carrotquest-client

Simple carrotquest.io client with Promises for nodejs.

test

Carrot quest web api documentation: https://carrotquest.io/developers/webapi/

Installation

npm install mds-carrotquest-client or yarn add mds-carrotquest-client

Examples

const CarrotQuest = require('mds-carrotquest-client')
const client = new CarrotQuest(apiKey)

// Get all users
client.apps.users().then(users => {
  console.log(users)
}).catch(err => {
  console.error(err)
})

Methods

Get active users

client.apps.activeUsers()

Get app users

client.apps.users(query)
ParameterType
queryObject

Get conversations

client.apps.conversations(query)
ParameterType
queryObject

Get app channels

client.apps.channels()

Get user

client.users.get(id, query)
ParameterType
idString
queryObject

Get user events

client.users.events(id, query)
ParameterType
idString
queryObject

Get user conversations

client.users.conversations(id, query)
ParameterType
idString
queryObject

Create user event

client.users.createEvent(id, query)
ParameterType
idString
queryObject

Set user props

client.users.setProps(id, query)
ParameterType
idString
queryObject

Set user presence

client.users.setPresence(id, query)
ParameterType
idString
queryObject

Send a message to user

client.users.sendMessage(id, query)
ParameterType
idString
queryObject

Start a conversation with user

client.users.startConversation(id, query)
ParameterType
idString
queryObject

Unsubscribe user email

client.users.unsubscribeEmail(id, query)
ParameterType
idString
queryObject

Testing

Create .env file with your Carrot Quest API key and run yarn test:

echo API_KEY > .env
yarn install
yarn test