Skip to content

Latest commit

 

History

History
executable file
·
221 lines (150 loc) · 7.03 KB

ExportApi.md

File metadata and controls

executable file
·
221 lines (150 loc) · 7.03 KB

ArtikCloud.ExportApi

All URIs are relative to https://api.artik.cloud/v1.1

Method HTTP request Description
exportRequest POST /messages/export Create Export Request
getExportHistory GET /messages/export/history Get Export History
getExportResult GET /messages/export/{exportId}/result Get Export Result
getExportStatus GET /messages/export/{exportId}/status Check Export Status

exportRequest

ExportRequestResponse exportRequest(exportRequestInfo)

Create Export Request

Export normalized messages. The following input combinations are supported:<br/><table><tr><th>Combination</th><th>Parameters</th><th>Description</th></tr><tr><td>Get by users</td><td>uids</td><td>Search by a list of User IDs. For each user in the list, the current authenticated user must have read access over the specified user.</td></tr><tr><td>Get by devices</td><td>sdids</td><td>Search by Source Device IDs.</td></tr><tr><td>Get by device types</td><td>uids,sdtids</td><td>Search by list of Source Device Type IDs for the given list of users.</td></tr><tr><td>Get by trial</td><td>trialId</td><td>Search by Trial ID.</td></tr><tr><td>Get by combination of parameters</td><td>uids,sdids,sdtids</td><td>Search by list of Source Device IDs. Each Device ID must belong to a Source Device Type ID and a User ID.</td></tr><tr><td>Common</td><td>startDate,endDate,order,format,url,csvHeaders</td><td>Parameters that can be used with the above combinations.</td></tr></table>

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"

var apiInstance = new ArtikCloud.ExportApi()

var exportRequestInfo = new ArtikCloud.ExportRequestInfo(); // {ExportRequestInfo} ExportRequest object that is passed in the body


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.exportRequest(exportRequestInfo, callback);

Parameters

Name Type Description Notes
exportRequestInfo ExportRequestInfo ExportRequest object that is passed in the body

Return type

ExportRequestResponse

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json

getExportHistory

ExportHistoryResponse getExportHistory(opts)

Get Export History

Get the history of export requests.

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"

var apiInstance = new ArtikCloud.ExportApi()

var opts = { 
  'trialId': "trialId_example", // {String} Filter by trialId.
  'count': 56, // {Number} Pagination count.
  'offset': 56 // {Number} Pagination offset.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getExportHistory(opts, callback);

Parameters

Name Type Description Notes
trialId String Filter by trialId. [optional]
count Number Pagination count. [optional]
offset Number Pagination offset. [optional]

Return type

ExportHistoryResponse

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json

getExportResult

'String' getExportResult(exportId)

Get Export Result

Retrieve result of the export query in tgz format. The tar file may contain one or more files with the results.

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"

var apiInstance = new ArtikCloud.ExportApi()

var exportId = "exportId_example"; // {String} Export ID of the export query.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getExportResult(exportId, callback);

Parameters

Name Type Description Notes
exportId String Export ID of the export query.

Return type

'String'

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json

getExportStatus

ExportStatusResponse getExportStatus(exportId)

Check Export Status

Check status of the export query.

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

// Configure OAuth2 access token for authorization: artikcloud_oauth
var artikcloud_oauth = defaultClient.authentications['artikcloud_oauth'];
artikcloud_oauth.accessToken = "YOUR ACCESS TOKEN"

var apiInstance = new ArtikCloud.ExportApi()

var exportId = "exportId_example"; // {String} Export ID of the export query.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getExportStatus(exportId, callback);

Parameters

Name Type Description Notes
exportId String Export ID of the export query.

Return type

ExportStatusResponse

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json