npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sendx-javascript-sdk

v1.0.5

Published

SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around

Downloads

399

Readme

SendX JavaScript SDK npm version

Introduction

SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations.

The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.

Installation

For Node.js

npm

Then install it via npm:

npm install sendx-javascript-sdk --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: apiKeyAuth
let apiKeyAuth = defaultClient.authentications['apiKeyAuth'];
apiKeyAuth.apiKey = 'YOUR API KEY';


let apiInstance = new sendx.ContactApi(); // ContactApi |
let contactRequest = new sendx.ContactRequest(); // ContactRequest |

contactRequest.email = "[email protected]";
contactRequest.firstName = "Jane";
contactRequest.lastName = "Doe"; 
contactRequest.company = "Tech Solutions Inc.";
contactRequest.lastTrackedIp = "34.94.159.140";
contactRequest.customFields = { "1231nfenife213": "VIP", "1434bife23bfij32": "Special Offer Subscriber" };
contactRequest.lists = ["234b324bjed32", "234bij3e2eyv3v2i"];
contactRequest.tags = ["234bijn2ei2jbu4", "2342bijhb2ijneni"]; 

apiInstance.createContact(contactRequest).then((data) => {
    console.log('API called successfully. Contact created: ' + JSON.stringify(data, null, 2));
}, (error) => {
    console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.sendx.io/api/v1/rest

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- sendx.CampaignApi | createCampaign | POST /campaign | Create Campaign sendx.CampaignApi | deleteCampaign | DELETE /campaign/{campaignId} | Delete Campaign sendx.CampaignApi | editCampaign | PUT /campaign/{campaignId} | Edit Campaign sendx.CampaignApi | getAllCampaigns | GET /campaign | Get All Campaigns sendx.CampaignApi | getCampaignById | GET /campaign/{campaignId} | Get Campaign By Id sendx.ContactApi | createContact | POST /contact | Create a contact sendx.ContactApi | deleteContact | DELETE /contact/{contactId} | Delete Contact sendx.ContactApi | getAllContacts | GET /contact | Get All Contacts sendx.ContactApi | getContactById | GET /contact/{contactId} | Get Contact by ID sendx.ContactApi | unsubscribeContact | POST /contact/unsubscribe/{contactId} | Unsubscribe Contact sendx.ContactApi | updateContact | PUT /contact/{contactId} | Update Contact sendx.ListApi | createList | POST /list | Create List sendx.ListApi | deleteList | DELETE /list/{listId} | Delete List sendx.ListApi | getAllLists | GET /list | Get All Lists sendx.ListApi | getListById | GET /list/{listId} | Get List sendx.ListApi | updateList | PUT /list/{listId} | Update List sendx.ReportsApi | getCampaignReport | GET /report/campaign/{campaignId} | Get CampaignReport Data sendx.SenderApi | createSender | POST /sender | Create Sender sendx.SenderApi | getAllSenders | GET /sender | Get All Senders sendx.TagsApi | createTag | POST /tag | Create a Tag sendx.TagsApi | deleteTag | DELETE /tag/{tagId} | Delete a Tag sendx.TagsApi | getAllTags | GET /tag | Get All Tags sendx.TagsApi | getTagById | GET /tag/{tagId} | Get a Tag by ID sendx.TagsApi | updateTag | PUT /tag/{tagId} | Update a Tag

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

apiKeyAuth

  • Type: API key
  • API key parameter name: X-Team-ApiKey
  • Location: HTTP header