Skip to content

Latest commit

 

History

History
452 lines (284 loc) · 11.4 KB

Users.md

File metadata and controls

452 lines (284 loc) · 11.4 KB

OrderCloud.Users

All URIs are relative to https://api.ordercloud.io/v1

Method HTTP request Description
Create POST /buyers/{buyerID}/users
Delete DELETE /buyers/{buyerID}/users/{userID}
Get GET /buyers/{buyerID}/users/{userID}
GetAccessToken POST /buyers/{buyerID}/users/{userID}/accesstoken
List GET /buyers/{buyerID}/users
Move POST /buyers/{buyerID}/users/{userID}/moveto/{newBuyerID}
Patch PATCH /buyers/{buyerID}/users/{userID}
Save PUT /buyers/{buyerID}/users/{userID}

Create

User Create(buyerID, user)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var user = new OrderCloud.User(); // User | 

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
user User

Return type

User

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Delete

Delete(buyerID, userID)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var userID = "userID_example"; // String | ID of the user.

apiInstance.Delete(buyerID, userID).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userID String ID of the user.

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Get

User Get(buyerID, userID)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var userID = "userID_example"; // String | ID of the user.

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userID String ID of the user.

Return type

User

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

GetAccessToken

AccessToken GetAccessToken(buyerID, userID, impersonateTokenRequest)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var userID = "userID_example"; // String | ID of the user.

var impersonateTokenRequest = new OrderCloud.ImpersonateTokenRequest(); // ImpersonateTokenRequest | 

apiInstance.GetAccessToken(buyerID, userID, impersonateTokenRequest).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userID String ID of the user.
impersonateTokenRequest ImpersonateTokenRequest

Return type

AccessToken

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

List

ListUser List(buyerID, opts)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var opts = { 
  'userGroupID': "userGroupID_example", // String | ID of the user group.
  'search': "search_example", // String | Word or phrase to search for.
  'searchOn': "searchOn_example", // String | Comma-delimited list of fields to search on.
  'sortBy': "sortBy_example", // String | Comma-delimited list of fields to sort by.
  'page': 56, // Number | Page of results to return. Default: 1
  'pageSize': 56, // Number | Number of results to return per page. Default: 20, max: 100.
  'filters': {key: "filters_example"} // {String: String} | Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
};
apiInstance.List(buyerID, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userGroupID String ID of the user group. [optional]
search String Word or phrase to search for. [optional]
searchOn String Comma-delimited list of fields to search on. [optional]
sortBy String Comma-delimited list of fields to sort by. [optional]
page Number Page of results to return. Default: 1 [optional]
pageSize Number Number of results to return per page. Default: 20, max: 100. [optional]
filters {String: String} Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???' [optional]

Return type

ListUser

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Move

User Move(buyerID, userID, newBuyerID, orders)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var userID = "userID_example"; // String | ID of the user.

var newBuyerID = "newBuyerID_example"; // String | ID of the new buyer.

var orders = "orders_example"; // String | Orders of the user. Possible values: None, Unsubmitted, All.

apiInstance.Move(buyerID, userID, newBuyerID, orders).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userID String ID of the user.
newBuyerID String ID of the new buyer.
orders String Orders of the user. Possible values: None, Unsubmitted, All.

Return type

User

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Patch

User Patch(buyerID, userID, partialUser)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var userID = "userID_example"; // String | ID of the user.

var partialUser = new OrderCloud.User(); // User | 

apiInstance.Patch(buyerID, userID, partialUser).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userID String ID of the user.
partialUser User

Return type

User

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Save

User Save(buyerID, userID, user)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

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

var apiInstance = new OrderCloud.Users();

var buyerID = "buyerID_example"; // String | ID of the buyer.

var userID = "userID_example"; // String | ID of the user.

var user = new OrderCloud.User(); // User | 

apiInstance.Save(buyerID, userID, user).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
userID String ID of the user.
user User

Return type

User

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json