All Projects → salesforce-marketingcloud → FuelSDK-Node-REST

salesforce-marketingcloud / FuelSDK-Node-REST

Licence: BSD-3-Clause license
Node REST client w/ auth to access the Salesforce Marketing Cloud (formerly ExactTarget) API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to FuelSDK-Node-REST

FuelSDK-Node-Auth
Node authentication library for accessing the Salesforce Marketing Cloud APIs. Used in REST and SOAP client
Stars: ✭ 14 (-51.72%)
Mutual labels:  fuel, salesforce, marketing-cloud, exacttarget
uswds-sf-lightning-community
A Salesforce Lightning Community Theme and related components built upon US Web Design System
Stars: ✭ 24 (-17.24%)
Mutual labels:  salesforce
sfdc-error-playground
Lightning & Apex Error Playground
Stars: ✭ 30 (+3.45%)
Mutual labels:  salesforce
ApexCallouts
A lightweight Apex library for making HTTP callouts. Works with remote site settings and named credentials.
Stars: ✭ 32 (+10.34%)
Mutual labels:  salesforce
dreaminvest-lwc
Sample application for Lightning Web Components on Salesforce Platform. Part of the sample gallery. Financial services use case. Get inspired and learn best practices.
Stars: ✭ 41 (+41.38%)
Mutual labels:  salesforce
R.apex
Functional utility library for Apex
Stars: ✭ 80 (+175.86%)
Mutual labels:  salesforce
apex-rest-route
A simple framework for building Restful API on Salesforce
Stars: ✭ 75 (+158.62%)
Mutual labels:  salesforce
salesforce-iam-flows
Node.js application that implements some of the most common SAML and OAuth flows in Salesforce.
Stars: ✭ 31 (+6.9%)
Mutual labels:  salesforce
spaghetti-cmd-loader
Salesforce Custom Metadata Type Loader, designed for Lightning Experience
Stars: ✭ 13 (-55.17%)
Mutual labels:  salesforce
sa11y
Salesforce Automated Accessibility Testing Libraries
Stars: ✭ 58 (+100%)
Mutual labels:  salesforce
texei-sfdx-plugin
Texeï's plugin for sfdx
Stars: ✭ 99 (+241.38%)
Mutual labels:  salesforce
timeline-component-lwc
This component enables timeline view for Salesforce Record history.
Stars: ✭ 18 (-37.93%)
Mutual labels:  salesforce
aiosfstream
Salesforce Streaming API client for asyncio
Stars: ✭ 46 (+58.62%)
Mutual labels:  salesforce
DXMate
Sublime Text 3 plugin to provide integration with the Salesforce DX CLI
Stars: ✭ 14 (-51.72%)
Mutual labels:  salesforce
basket
Mozilla's email newsletter subscription management API service
Stars: ✭ 12 (-58.62%)
Mutual labels:  salesforce
Salesforce-Custom-Path-Assistant-LWC
A Salesforce custom path assistant built using only Lightning Web Components
Stars: ✭ 37 (+27.59%)
Mutual labels:  salesforce
sfdx-git-packager
Generates a "delta" metadata package based on the difference between two git refs (branches/commits)
Stars: ✭ 93 (+220.69%)
Mutual labels:  salesforce
canvas-starter-kit
A template for developing on the Salesforce Canvas platform in Javascript.
Stars: ✭ 23 (-20.69%)
Mutual labels:  salesforce
fuel-core
Rust full node implementation of the Fuel v2 protocol.
Stars: ✭ 93 (+220.69%)
Mutual labels:  fuel
apex-tmLanguage
Salesforce Apex Language syntax grammar used for colorization
Stars: ✭ 27 (-6.9%)
Mutual labels:  salesforce

Fuel REST Client (for Node.js) Build Status Greenkeeper badge

This repo used to be located at https://github.com/exacttarget/Fuel-Node-REST

This library allows users access to the Salesforce Marketing Cloud REST API at a low level.

Support

The Salesforce Marketing Cloud SDKs are community-supported projects. The SDK source code, samples, and documentation are publicly available on Github to use as-is or fork and modify for your needs. We invite everyone in the community to collaborate with us on Github and submit pull requests to help improve the source code and samples.

Installation

npm install fuel-rest --save

yarn add fuel-rest

Initialization

new FuelRest(options) - Initialization

  • options.auth
  • options.origin or options.restEndpoint
  • options.headers
    • Required: no
    • Type: Object
    • set headers that apply to all REST requests (not auth requests)
  • options.globalReqOptions
    • Required: no
    • Type: Object
    • set configuration options that apply to all requests (auth + REST)

API

  • apiRequest(options, callback)
    • options - see request modules options
    • options.auth - will be passed into getAccessToken inside Fuel Auth
    • options.uri - can either be a full url or a path that is appended to options.origin used at initialization (url.resolve)
    • options.retry - boolean value representing whether or not to retry request (and request new token) on 401 invalid token response. default: false
    • callback - executed after task is completed.
      • if no callback is passed, you'll need to use the promise interface
  • get | post | put | patch | delete(options, callback)
    • options - see apiRequest options
    • options.retry - see above for description. default: true
    • callback - see apiRequest options
    • Request method will be overwritten by these methods. It will be set to same value as the name of the method used

Setting up the client

const FuelRest = require('fuel-rest');
const options = {
	auth: {
		// options you want passed when Fuel Auth is initialized
		clientId: 'clientId',
		clientSecret: 'clientSecret'
	},
	origin: 'https://alternate.rest.endpoint.com' // default --> https://www.exacttargetapis.com
};

const RestClient = new FuelRest(options);

Examples

const options = {
	uri: '/platform/v1/endpoints',
	headers: {}
	// other request options
};

// CANNOT USE BOTH CALLBACKS AND PROMISES TOGETHER
RestClient.get(options, (err, response) => {
	if (err) {
		// error here
		console.log(err);
	}

	// will be delivered with 200, 400, 401, 500, etc status codes
	// response.body === payload from response
	// response.res === full response from request client
	console.log(response);
});

// or with promises
RestClient.get(options)
	.then(response => {
		// will be delivered with 200, 400, 401, 500, etc status codes
		// response.body === payload from response
		// response.res === full response from request client
		console.log(response);
	})
	.catch(err => console.log(err));

Contributors

Contributing

We welcome all contributions and issues! There's only one way to make this better, and that's by using it. If you would like to contribute, please checkout our guidelines!

Supported Node Versions

We follow the Node.js Release Schedule. When the current date is past the version's "Maintenance LTS End" it will no longer be supported by this library. A major release on this module will be published when this occurs.

ChangeLog

  • See tags/release page for release notes after 0.7.2
  • 0.7.2 - 2014-10-16 - account for content-type header not being present on API response
  • 0.7.1 - 2014-09-09 - removed unneeded "!!"
  • 0.7.0 - 2014-08-29 (public release, 1st npm version)
    • request retry on 401 invalid token response
    • created helpers file for certain functions
    • updated error delivering/throwing
  • 0.6.0 - 2014-08-26 - added patch method
  • 0.5.0 - 2014-08-26 - API overhaul (apiRequest + all http methods) - breaking
  • 0.4.0 - 2014-08-25 - changed object initialization - breaking
  • 0.3.0 - 2014-08-20
    • added ability to use initialized fuel auth
    • updated travis ci config
    • added license
  • 0.2.0 - 2014-08-09 - removed event emitter - breaking
  • 0.1.0 - 2014-08-07
    • initial module
    • initial unit tests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].