DNT API
Node.JS library for communicating with Turistforeningen's API.
Table of Contents
Requirements
Require Node.JS version >= 0.10
.
Installing
npm install dnt-api --save
Usage
var DNT = ;
Class: DNT
var dnt = 'My Application/1.0' 'myApiKey';
object
query, function
cb)
dnt.getMemberFor(The getMemberFor()
method is used to get details for a given member from the
membership register.
query parameter
The query
parameter can at the moment have either one, or both, of the following
properties:
sherpa_id
- which is the local user id for Sherpa 3.medlemsnummer
which is the membership number for a given membership.
cb parameter
The callback function to this requests takes tree parameters:
Error
err - this is an error if the HTTP request itself failed.number
statusCode - HTTP status code returned from the API.object
memberData - data returned from the API.
Example
dnt;
object
query, function
cb)
dnt.getAssociationsFor(The getAssociationsFor()
method is used to get associations (NO foreninger)
for a given member from the membership register.
query parameter
The query
parameter can at the moment have either one, or both, of the following
properties:
bruker_sherpa_id
- which is the local user id for Sherpa 3.bruker_medlemsnummer
which is the membership number for a given membership.
cb parameter
The callback function to this requests takes tree parameters:
Error
err - this is an error if the HTTP request itself failed.number
statusCode - HTTP status code returned from the API.Array
associations - data returned from the API.
Example
dnt;