@eventfarm/legacy-sdk

eventfarm-sdk

The legacy-sdk package has been archived and users should use @eventfarm/javascript-sdk
Last updated 2 years ago by event-farm .
Original npm · Tarball · package.json
$ cnpm install @eventfarm/legacy-sdk 
SYNC missed versions from official npm registry.

EventFarm SDK

Table of Contents

Overview

Eventfarm SDK allows the user to interface easily with the eventfarm API.

Install

To install the npm package you will need access to the repo.

npm install --save https://github.com/startupdevs/eventfarm-sdk.git

Requirements

The SDK requires 5 key items. All the below items can be provided by EventFarm.

  1. PRIVATE KEY
  2. PUBLIC KEY
  3. AUTH PREFIX
  4. USERNAME
  5. PASSWORD

SDK Examples

Instantiating

Before using you must initialize and login. Once successfull you will be given an object to work which contans event, reporting, group, user objects.

SDK = require('eventfarm-sdk')(PRIVATE_KEY, PUBLIC_KEY, AUTH_PREFIX);
SDK.login(USERNAME, PASSWORD, function(err, data) {
    //Your Code here Or use Promises.
})

Events

Interface with the events endpoints.

Get Event

Returns a single instance of an event.

SDK.event.getEvent(eventId, function(err, data){});

Get Events

Returns a list of events the user has access to. Returns a collection of event objects.

SDK.event.getEvents(function(err, data) {});

Get Analytics

Returns very basic event analytics information.

SDK.event.getAnalytics(eventId, function(err, data){})

Get Stats Email

Sends out an email with detailed event stats to the user making the request.

SDK.event.emailStats(eventId, function(err, data){})

Create Event

Create a new event.

SDK.event.create(options, function(err, data) {})

Params

  • Options must be a JSON object with the below properties.
  1. name: "Test Babel",
  2. poolId: "7fff1f7a-0000-4570-abab-aa10128d354c",
  3. poolAllotmentId: '',
  4. type: "eventfarm",
  5. emailAddress: "todd.cornett@eventfarm.com",
  6. startTime: new Date(),
  7. endTime: new Date("2017-04-18T14:01:00+00:00"),
  8. timeZone: -7

Groups

Group allows the user to interact with the group API endpoints.

Get Group

Get a specific group

SDK.group.get(groupId, function(err, data) {

List Groups

List the groups

SDK.group.list(function(err, data) {

Create Group

Create a new group.

SDK.group.create(uniqueGroupName, function(err, data) {

Remove Group

Remove a group. Must have access to do so.

SDK.group.remove(uniqueGroupName, function(err, data){});

Update Group

Update a group.

SDK.group.update(uniqueGroupName, groupNewName, function(err, data) {})

Get Users

Get a list of users within the group.

SDK.group.getUsers(groupId, null, function(err, data) {

Add User

Add a user to the group.

SDK.group.addUsers(groupId, ['armando', 'userId1', 'userId2'], function(err, data) {})

Parameters

  • groupId - Group Id
  • usersToAddToGroup - Array containing the users to add to the group.

Remove User

Remove a user from a specific group.

SDK.group.removeUser(groupId, userId, function(err, data) {})

Group Permissions

Get Group Permissions

Fetch the permissons for a specific group.

SDK.group_permission.get(groupId, userId, function(err, data) {})

Users

Get User Info

Fetch user information.

SDK.user.getInfo(userId, function(err, data) {})

Get Users

Get users.

SDK.user.getUsers(function(err, data) {})

Get User Permissions

Get the user's permissons.

SDK.user.getPermissions(userId, function(err, data) {})

Create User

Create a new user. Must have access to do so.

SDK.user.create(newUserData, function(err, data) {})

Parameters

  1. newUserData - JSON Object
  • firstName: "Armando"
  • lastName: "Padilla",
  • email: "armando.padilla@dws.la",
  • password: "password",
  • address: Address Object
Address Object
  • address: "6410 Haas Avenue"
  • city: "Los Angeles"
  • state: "CA"
  • country: "USA"
  • postalCode: "90047"

Search Users

Search users.

SDK.user.search(searchTerm, function(err, data) {})

Reports

Get Report

Fetch a report for a specific event. For fetching ALL the reports for an event leave out the reportId.

SDK.report.getReports(eventId, reportId, function(err, data) {})

Emails

Get Email

Returns an email object for a specific email

SDK.email.get(emailId, function(err, data) {})

Get Event Emails

Get all the emails for a specific event.

SDK.email.getEventEmails(eventId, filter, function(err, data) {})

Parameters

  • eventId - Unique ID of the event.
  • filter - 'sent' or 'outbox'

Get Email Action Stats

Get the stats for all email actions.

 SDK.email.getEmailActionStats(eventId, function(err, data) {})

Invitation

Get Invitation

Get a specific invitation

SDK.invitation.get(invitationId, function(err, data) {})

Create Invitation

Create a new invitation

SDK.invitation.create(data, function(err, data) {})

Parameters

  • data - JSON with Invitation Properties

Invitation Properties

  • checkIn: true
  • checkInNotes: 'This is only a test',
  • eventId: eventId,
  • firstName: 'TEST FIRST',
  • lastName: 'TEST LAST',
  • inviteCount: 1,
  • stackId: '123',
  • userId: '123',
  • userNameId: 'armando'

Response Objects

Event Object

'{"id":"7fff5387-0000-4570-abae-2e16d34d1d44", "name":"Babel Villa", "type":"eventfarm", "used":false, "language":"eng", "category":null, "attributes":["duplicate_emails","skip_event_allocate_display"], "created":"2016-04-11T14:01:18+00:00", "modified":"2016-04-11T14:01:18+00:00", "poolId":"7fff1f7a-0000-4570-abab-aa10128d354c", "guestLimit":-1,"startTime":"2017-04-11T14:01:00+00:00", "endTime":"2017-04-12T16:01:00+00:00", "timeZone":-7, "publicName":null, "mapSource":"google", "venueName":null, "venueAddress":null, "venueArtistName":null, "venueArtistDeposit":0, "venueCheckName":null, "venueFlatPerc":0, "venueFlatFee":0, "venueMemo":null, "donateValues":null, "donateEmailId":null, "minSize":0, "maxSize":0, "emailAddress":"todd.cornett@eventfarm.com", "shippingOption":"none", "shippingCost":0, "rfidConnect":null, "rfidEvent":null, "backgroundUrl":null, "altKeyword":"babelvilla", "twitterHandle":null, "twitterKeyword":null, "instagramHandle":null, "instagramKeyword":null, "facebookHandle":null, "isCio":0, "isListly":0}' }

Current Tags

  • 2.0.23                                ...           latest (2 years ago)

1 Versions

  • 2.0.23 [deprecated]           ...           2 years ago
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 3
Dependencies (3)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |