Skip to content

Latest commit

 

History

History
executable file
·
161 lines (108 loc) · 3.89 KB

TokensApi.md

File metadata and controls

executable file
·
161 lines (108 loc) · 3.89 KB

ArtikCloud.TokensApi

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

Method HTTP request Description
checkToken POST /accounts/checkToken Check Token
refreshToken POST /accounts/token Refresh Token
tokenInfo GET /accounts/tokenInfo Token Info

checkToken

CheckTokenResponse checkToken(tokenInfo)

Check Token

(Deprecated) Check Token. See tokenInfo

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.TokensApi()

var tokenInfo = new ArtikCloud.TokenRequest(); // {TokenRequest} Token object to be checked


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

Parameters

Name Type Description Notes
tokenInfo TokenRequest Token object to be checked

Return type

CheckTokenResponse

Authorization

artikcloud_oauth

HTTP reuqest headers

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

refreshToken

RefreshTokenResponse refreshToken(grantType, refreshToken)

Refresh Token

Refresh Token

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.TokensApi()

var grantType = "grantType_example"; // {String} Grant Type.

var refreshToken = "refreshToken_example"; // {String} Refresh Token.


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

Parameters

Name Type Description Notes
grantType String Grant Type.
refreshToken String Refresh Token.

Return type

RefreshTokenResponse

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

tokenInfo

TokenInfoSuccessResponse tokenInfo

Token Info

Returns the Token Information

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.TokensApi()

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

Parameters

This endpoint does not need any parameter.

Return type

TokenInfoSuccessResponse

Authorization

artikcloud_oauth

HTTP reuqest headers

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