Skip to content

elucidat/elucidat-node-api-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elucidat API Integration

A library for connecting to the Elucidat API. Find out more about Elucidat at www.elucidat.com

Installation

Using npm:

$ npm install elucidat-api 

Usage

An example for returning the HTML of a course using Node.js:


const elucidatAPI = require('elucidat-api');
const https = require('https');

const parameters = {
    path: 'releases/launch',
    consumer_key: '',
    consumer_secret: '',
    fields: {
        'release_code': '',
        'name': '',
        'email_address': ''
    }
};

elucidatAPI(parameters, function (statusCode, response) {
    if (response.url) {
        // finally load the contents of the page
        https.get(response.url, function (res) {
            var pageContent = '';
            res.on('data', function (chunk) {
                pageContent += chunk;
            }).on('end', function () {
                process.stdout.write(pageContent);
            });
        }).on('error', function (e) {
            console.error(e.message);
        }).end();
    } else {
        console.error(response);
    }
});

For other methods see the API documentation at help.elucidat.com.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published