mds-carrotquest-client
v1.2.0
Published
Simple carrotquest.io client with Promises for nodejs.
Downloads
2
Readme
mds-carrotquest-client
Simple carrotquest.io client with Promises for nodejs.
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)
|Parameter|Type| |---|---| |query|Object|
Get conversations
client.apps.conversations(query)
|Parameter|Type| |---|---| |query|Object|
Get app channels
client.apps.channels()
Get user
client.users.get(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Get user events
client.users.events(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Get user conversations
client.users.conversations(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Create user event
client.users.createEvent(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Set user props
client.users.setProps(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Set user presence
client.users.setPresence(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Send a message to user
client.users.sendMessage(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Start a conversation with user
client.users.startConversation(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Unsubscribe user email
client.users.unsubscribeEmail(id, query)
|Parameter|Type| |---|---| |id|String| |query|Object|
Testing
Create .env
file with your Carrot Quest API key and run yarn test
:
echo API_KEY > .env
yarn install
yarn test