GithubHelp home page GithubHelp logo

node-clang-rest's Introduction

node-clang-rest

Node based JSON/HTTP proxy to the Clang's SOAP webservice API.

This is a restful webservice that proxies HTTP requests to Clang's SOAP API, passing along any parameters in the query string. All requests are proxied to Clang using HTTPS. Returns SOAP responses as JSON.

Token

Authentication to the Clang Webservice API is done using a token (uuid). Contact the Support Desk of your Clang reseller to obtain a token. Contact Leads to Loyals if you'd like to learn more about using Clang and this API.

Pass the token as an uuid header or a _uuid query parameter. The supplied token will be proxied to Clang with each request.

Usage

  • GET /customers
  • GET /customers/39515
  • PUT /customers/39515
    {
      "firstname": "Christiaan"
    }
    
  • POST /customers
    {
      "firstname": "test",
      "emailAddress": "[email protected]"
    }
    
  • DELETE /customers/39515

The HTTP verb can be overriden using _method query parameter and you may send the parameters in the url as well.

  • GET /customers/39515?_method=PUT&firstname=Christiaan
  • GET /customers?_method=POST&firstname=test&[email protected]
  • GET /customers/39515_method=DELETE

(read more about RESTful conventions)

  • GET /emails/26597
  • POST /emails/26597/sendToCustomer
    {
      "customerId": 328191
    }
    

The last example is a custom action on a single resource. That is only allowed using POST.

Representation

Expect an array of objects when 200/201 or an object with a message property when an error occurred.

HTTP statusses as you would expect from a RESTful webservice remain intact.

node-clang-rest's People

Contributors

christiaanwesterbeek avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

leadstoloyals

node-clang-rest's Issues

Make POST do a lookup on customer and either create or update

POST on node.leadstoloyals.com/clang/customer/?firstname=qwerty&externalId=xyz&emailAddress=[email protected]

This should do a lookup for a customer on externalId first.
If none is found, do a lookup on emailAddress
If still none is found, do a create otherwise do an update on the first found

More on restfulness and custom actions
-http://stackoverflow.com/questions/630453/put-vs-post-in-rest
-http://stackoverflow.com/questions/10885152/rest-shouldnt-put-create-and-post-update
-http://microformats.org/wiki/rest/urls

uuid remains in application until app is restarted

Currently once an uuid is supplied it remains active for everybody how connects until the app is restarted (which you cannot do from the web)

This can be fixed by using sessions where the uuid is only valid in the user's session.

Abstract away clang

This app should allow the wrapping of other SOAP API's as well. All SOAP API should be wrapped in such a ways that they lead to a consisten and uniform RESTful JSON API.

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.