Skip to content
The Cervinodata JavaScript API Client allows you to retrieve data of multiple platforms with just one API connection.
JavaScript Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.openapi-generator
docs
src
test/api
.babelrc
.openapi-generator-ignore
.travis.yml
README.md
git_push.sh
mocha.opts
package-lock.json
package.json

README.md

cervinodata-api-client

CervinodataApiClient - JavaScript client for cervinodata-api-client

Before you get going with the Cervinodata API, set up Cervinodata (read the support page here: How to set up the Cervinodata API).

To use the Cervinodata API, you need all of the following:

  1. An active Cervinodata account, you can start a free trial here
  2. At least one connection to a platform (check here)
  3. At least one account switched ON (check here)
  4. At least one data refresh executed (check here)
  5. An active API token (check here)

If you wish to automate your Cervinodata API connection, check out the list of client API's at https://github.com/Cervinodata.

This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
  • API version: 1.0.0
  • Package version: 0.1.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install cervinodata-api-client --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your cervinodata-api-client from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/cervinodata/clientapi-javascript then install it via:

    npm install cervinodata/clientapi-javascript --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var CervinodataApiClient = require('cervinodata-api-client');

var defaultClient = CervinodataApiClient.ApiClient.instance;
// Configure Bearer access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"

var api = new CervinodataApiClient.AdvertisingDataApi()
var organisationUuid = "organisationUuid_example"; // {String} Organisation uuid
var opts = {
  'format': "format_example" // {String} Output format
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAdAccounts(organisationUuid, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://app.cervinodata.com/api/v1

Class Method HTTP request Description
CervinodataApiClient.AdvertisingDataApi getAdAccounts GET /data/ad-accounts/{organisationUuid} Return ad accounts by organisation
CervinodataApiClient.AdvertisingDataApi getAdCampaignReportPerDay GET /data/ad-campaign-report-per-day/{organisationUuid} Return ad campaign report per day by organisation
CervinodataApiClient.AdvertisingDataApi getAdCampaignReportPerOrganisationPerAccountPerDay GET /data/ad-campaign-report-per-organisation-per-account-per-day/{organisationUuids} Return ad campaign report per organisation per account per day
CervinodataApiClient.AdvertisingDataApi getAdCampaigns GET /data/ad-campaigns/{organisationUuid} Return ad campaigns by organisation
CervinodataApiClient.AnalyticsDataApi getViews GET /data/views/{organisationUuid} Return views by organisation
CervinodataApiClient.AnalyticsDataDefaultMetricsApi getAnalyticsReportPerCampaignPerDay GET /data/analytics-report-per-campaign-per-day/{organisationUuid} Return analytics report per campaign per day by organisation
CervinodataApiClient.AnalyticsDataDefaultMetricsApi getAnalyticsReportPerChannelGroupPerDay GET /data/analytics-report-per-channel-group-per-day/{organisationUuid} Return analytics report per channel group per day by organisation
CervinodataApiClient.AnalyticsDataDefaultMetricsApi getAnalyticsReportPerDevicePerChannelGroupPerOrganisationPerViewPerDay GET /data/analytics-report-per-device-per-channel-group-per-organisation-per-view-per-day/{organisationUuids} Return analytics report per device per channel group per organisation per view per day
CervinodataApiClient.AnalyticsDataDefaultMetricsApi getAnalyticsReportPerDevicePerDay GET /data/analytics-report-per-device-per-day/{organisationUuid} Return analytics report per device per day by organisation
CervinodataApiClient.AnalyticsDataDefaultMetricsApi getAnalyticsReportPerSourceMediumPerDay GET /data/analytics-report-per-source-medium-per-day/{organisationUuid} Return analytics report per source medium per day by organisation
CervinodataApiClient.AnalyticsDataGoalsApi getAnalyticsGoalReportPerCampaignPerDay GET /data/analytics-goal-report-per-campaign-per-day/{organisationUuid} Return analytics goal report per campaign per day by organisation
CervinodataApiClient.AnalyticsDataGoalsApi getAnalyticsGoalReportPerChannelGroupPerDay GET /data/analytics-goal-report-per-channel-group-per-day/{organisationUuid} Return analytics goal report per channel group per day by organisation
CervinodataApiClient.AnalyticsDataGoalsApi getAnalyticsGoalReportPerDevicePerDay GET /data/analytics-goal-report-per-device-per-day/{organisationUuid} Return analytics goal report per device per day by organisation
CervinodataApiClient.AnalyticsDataGoalsApi getAnalyticsGoalReportPerSourceMediumPerDay GET /data/analytics-goal-report-per-source-medium-per-day/{organisationUuid} Return analytics goal report per source medium per day by organisation
CervinodataApiClient.CampaignGroupApi getCampaignGroupAdReportPerOrganisationPerDay GET /data/campaign-group-ad-report-per-organisation-per-day/{organisationUuids} Return campaign group ad report per organisation per day
CervinodataApiClient.CampaignGroupApi getCampaignGroupAnalyticsReportPerOrganisationPerDay GET /data/campaign-group-analytics-report-per-organisation-per-day/{organisationUuids} Return campaign group analytics report per organisation per day
CervinodataApiClient.CampaignGroupApi getCampaignGroupReportPerOrganisationPerDay GET /data/campaign-group-report-per-organisation-per-day/{organisationUuids} Return campaign group report per organisation per day
CervinodataApiClient.GenericDataApi getCampaignGroups GET /data/campaign-groups Return campaign groups
CervinodataApiClient.GenericDataApi getOrganisations GET /data/organisations Return organisations

Documentation for Models

Documentation for Authorization

bearerAuth

  • Type: Bearer authentication
You can’t perform that action at this time.