0.2.0 • Published 8 years ago

sapi v0.2.0

Weekly downloads
4
License
-
Repository
github
Last release
8 years ago

Build Status Dependencies Status Coverage Status Published Version npm Badge

Sapi

Sapi is a Sensis API node.js client.

This is handy when you want to use Sensis API service from a Node.js application. Sapi module provides a chainable interface to set the endpoint parameters.

Tested with Sensis API version ob-20110511.

Installation

npm install sapi

or as a dependency in package.json file:

"dependencies": {
  "sapi": "x.y.z"
}

Usage

var Sapi = require('sapi'),
  sapi = new Sapi('apikey', {
    url: 'http://api.sensis.com.au/ob-20110511/test/',
    proxy: 'http://user:pass@proxy:8080'
  });

You can apply for Sensis API key from Sensis Developer Centre.

Parameters can then be chained to an endpoint:

sapi
  .param1('value1')
  .param2('value2')
  .param3('value3')
  .endpoint(function (err, result) {
    ...
  });

Search for restaurants in Melbourne:

sapi
  .query('restaurants')
  .location('Melbourne')
  .search(function (err, result) {
    ...
  });

Get listing details by ID:

sapi
  .query('12345')
  .getByListingId(function (err, result) {
    ...
  });

Retrieve categories metadata:

sapi
  .dataType('categories')
  .metadata(function (err, result) {
    ...
  });

Send report events:

sapi
  .userIp('192.1.2.3')
  .id('VyY2UiOi')
  .content('(03) 1234 5678')
  .report(function (err, result) {
    ...
  });

Endpoints

Check out Sensis API documentation for further details of the endpoints, a list of parameters, and response message structure:

Colophon

Developer's Guide

Build reports:

Articles:

0.2.0

8 years ago

0.1.3

10 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago