Code Monkey home page Code Monkey logo

content-direct-node's Introduction

Content Direct

Build Status

Node.js bindings for the Content Direct API.

Getting Started

Install the module with: npm install content-direct

var ContentDirect = require('content-direct')('sbx1');

Documentation

ContentDirect(environment, [defaultHeaders])

The ContentDirect constructor takes two arguments: environment and defaultHeaders. The environment variable should be the 4 alphanumberic code for the environment i.e. sbx1. The defaultHeaders variable is an object of key/value pairs that should be passed as headers in every API request.

Example:

var ContentDirect = require('content-direct')('sbx1', {
  'CD-User': 'username',
  'CD-Password': 'password',
  'CD-SystemId': 'systemId'
});

ContentDirect.Service.Method([headers], body, [callback])

All services and methods listed in the lib/api.js are supported. All API method documentation can be found at the Content Direct Web Services Guide. The headers variable should contain any additional headers that should be passed in the request in addition to the default headers. The body variable is the only required object. An optional callback can be passed which will be called with two variables: a non-null object if an error occured and a response object if the request was successful.

Example:

ContentDirect.Catalog.RetrieveProduct({
  Id: {
    Value: 12345
  }
}, function (err, res) {});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2014 David Caseria
Licensed under the MIT license.

content-direct-node's People

Contributors

davidcaseria avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.