Skip to content

Latest commit

 

History

History
749 lines (476 loc) · 17.5 KB

JUserApi.md

File metadata and controls

749 lines (476 loc) · 17.5 KB

KodingApi.JUserApi

All URIs are relative to https://koding.com/remote.api

Method HTTP request Description
authenticateWithOauth POST /JUser.authenticateWithOauth
changeEmail POST /JUser.changeEmail
changePassword POST /JUser.changePassword
convert POST /JUser.convert
emailAvailable POST /JUser.emailAvailable
fetchUser POST /JUser.fetchUser
getSSHKeys POST /JUser.getSSHKeys
login POST /JUser.login
logout POST /JUser.logout
setSSHKeys POST /JUser.setSSHKeys
unregister POST /JUser.unregister
usernameAvailable POST /JUser.usernameAvailable
verifyByPin POST /JUser.verifyByPin
verifyPassword POST /JUser.verifyPassword
whoami POST /JUser.whoami

authenticateWithOauth

DefaultResponse authenticateWithOauth(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.authenticateWithOauth(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

changeEmail

DefaultResponse changeEmail(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.changeEmail(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

changePassword

DefaultResponse changePassword(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.changePassword(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

convert

DefaultResponse convert(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.convert(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

emailAvailable

DefaultResponse emailAvailable(body)

Method JUser.emailAvailable

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.emailAvailable(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

fetchUser

DefaultResponse fetchUser()

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();
apiInstance.fetchUser().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

getSSHKeys

DefaultResponse getSSHKeys()

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();
apiInstance.getSSHKeys().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

login

DefaultResponse login(body)

Method JUser.login

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.login(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

logout

DefaultResponse logout()

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();
apiInstance.logout().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

setSSHKeys

DefaultResponse setSSHKeys(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.setSSHKeys(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

unregister

DefaultResponse unregister(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.unregister(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

usernameAvailable

DefaultResponse usernameAvailable(body)

Method JUser.usernameAvailable

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.usernameAvailable(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

verifyByPin

DefaultResponse verifyByPin(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.verifyByPin(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

verifyPassword

DefaultResponse verifyPassword(body)

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();

var body = new KodingApi.DefaultSelector(); // DefaultSelector | body of the request

apiInstance.verifyPassword(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body DefaultSelector body of the request

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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

whoami

DefaultResponse whoami()

whoami Returns your JAccount instance based on the session data

Example

var KodingApi = require('koding-api');
var defaultClient = KodingApi.ApiClient.default;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

var apiInstance = new KodingApi.JUserApi();
apiInstance.whoami().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

DefaultResponse

Authorization

Bearer

HTTP request headers

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