Skip to content

Latest commit

 

History

History
961 lines (698 loc) · 27.8 KB

me.md

File metadata and controls

961 lines (698 loc) · 27.8 KB

Me Actions

Details on the various actions that can be performed on the Me resource, including the expected parameters and the potential responses.

Contents

Add Recent Item

Adds an item to a recent item list

var params = {
  data: myData
};

// with callbacks
client.me.addRecentItem(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.addRecentItem(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.addRecentItem.

Available Parameters

Name Type Required Description Default Example
data Recent Item Y Object containing recent item info Recent Item Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Recent Item List Updated recent item list

Error Responses

Code Type Description
400 Error Error if malformed request

Change Password

Changes the current user's password and optionally logs out all other sessions

var params = {
  data: myData
};

// with callbacks
client.me.changePassword(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.changePassword(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.changePassword.

Available Parameters

Name Type Required Description Default Example
data Change Password Y Object containing the password change info Change Password Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Authenticated User A new, valid, auth token (potentially all previous tokens are now invalid)

Error Responses

Code Type Description
400 Error Error if malformed request

Delete

Deletes the current user

var params = {
  credentials: myCredentials
};

// with callbacks
client.me.delete(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.delete(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.delete.

Available Parameters

Name Type Required Description Default Example
credentials User Credentials Y User authentication credentials User Credentials Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Success If the user was successfully deleted

Error Responses

Code Type Description
400 Error Error if malformed request

Device Counts

Returns device counts by day for the time range specified for all applications the current user owns

var params = {}; // all params are optional

// with callbacks
client.me.deviceCounts(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.deviceCounts(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.deviceCounts.

Available Parameters

Name Type Required Description Default Example
start string N Start of range for device count query (ms since epoch) 0
end string N End of range for device count query (ms since epoch) 1465790400000
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Device Counts Device counts by day

Error Responses

Code Type Description
400 Error Error if malformed request

Disable Two Factor Auth

Disables multi-factor authentication for the current user

var params = {
  data: myData
};

// with callbacks
client.me.disableTwoFactorAuth(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.disableTwoFactorAuth(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.disableTwoFactorAuth.

Available Parameters

Name Type Required Description Default Example
data Disable Multi-Factor Authentication Y Object containing multi-factor authentication properties Disable Multi-Factor Authentication Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Disconnect Github

Disconnects the user from Github

var params = {}; // all params are optional

// with callbacks
client.me.disconnectGithub(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.disconnectGithub(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.disconnectGithub.

Available Parameters

Name Type Required Description Default Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Enable Two Factor Auth

Enables multi-factor authentication for the current user

var params = {
  data: myData
};

// with callbacks
client.me.enableTwoFactorAuth(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.enableTwoFactorAuth(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.enableTwoFactorAuth.

Available Parameters

Name Type Required Description Default Example
data Enable Multi-Factor Authentication Y Object containing multi-factor authentication properties Enable Multi-Factor Authentication Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Fetch Recent Items

Gets a recent item list

var params = {
  itemType: myItemType
};

// with callbacks
client.me.fetchRecentItems(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.fetchRecentItems(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.fetchRecentItems.

Available Parameters

Name Type Required Description Default Example
parentId string N Parent id of the recent list 575ec8687ae143cd83dc4a97
itemType undefined Y Item type to get the recent list of. Accepted values are: application, device, flow, dashboard, organization application
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Recent Item List Recent item list

Error Responses

Code Type Description
400 Error Error if malformed request

Generate Two Factor Auth

Returns the multi-factor authentication key for the current user

var params = {}; // all params are optional

// with callbacks
client.me.generateTwoFactorAuth(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.generateTwoFactorAuth(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.generateTwoFactorAuth.

Available Parameters

Name Type Required Description Default Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Multi-Factor Authentication Info Multi-factor authentication info

Error Responses

Code Type Description
400 Error Error if malformed request

Get

Retrieves information on the current user

var params = {}; // all params are optional

// with callbacks
client.me.get(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.get(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.get.

Available Parameters

Name Type Required Description Default Example
includeRecent undefined N Should the user include recent app/dashboard info true
summaryExclude string N Comma-separated list of summary fields to exclude from user summary payloadCount
summaryInclude string N Comma-separated list of summary fields to include in user summary payloadCount
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Me Current user information

Error Responses

Code Type Description

Invite

Retrieves information for an invitation to an organization

var params = {
  inviteId: myInviteId
};

// with callbacks
client.me.invite(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.invite(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.invite.

Available Parameters

Name Type Required Description Default Example
inviteId string Y ID associated with the invitation 575ec8687ae143cd83dc4a97
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Organization Invitation Information For User Information about invitation

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if invite not found

Invites

Retrieves pending organization invitations for a user

var params = {}; // all params are optional

// with callbacks
client.me.invites(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.invites(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.invites.

Available Parameters

Name Type Required Description Default Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 User Organization Invitations Information about invitations

Error Responses

Code Type Description
400 Error Error if malformed request

Notebook Minute Counts

Returns notebook execution usage by day for the time range specified for all applications the current user owns

var params = {}; // all params are optional

// with callbacks
client.me.notebookMinuteCounts(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.notebookMinuteCounts(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.notebookMinuteCounts.

Available Parameters

Name Type Required Description Default Example
start string N Start of range for notebook execution query (ms since epoch) 0
end string N End of range for notebook execution query (ms since epoch) 1465790400000
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Notebook Minute Counts Notebook usage information

Error Responses

Code Type Description
400 Error Error if malformed request

Patch

Updates information about the current user

var params = {
  user: myUser
};

// with callbacks
client.me.patch(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.patch(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.patch.

Available Parameters

Name Type Required Description Default Example
user Me Patch Y Object containing new user properties Me Patch Example
summaryExclude string N Comma-separated list of summary fields to exclude from user summary payloadCount
summaryInclude string N Comma-separated list of summary fields to include in user summary payloadCount
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Payload Counts

Returns payload counts for the time range specified for all applications the current user owns

var params = {}; // all params are optional

// with callbacks
client.me.payloadCounts(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.payloadCounts(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.payloadCounts.

Available Parameters

Name Type Required Description Default Example
start string N Start of range for payload count query (ms since epoch) 0
end string N End of range for payload count query (ms since epoch) 1465790400000
asBytes string N If the resulting stats should be returned as bytes false true
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Payload Stats Payload counts, by type and source

Error Responses

Code Type Description
400 Error Error if malformed request

Payload Counts Breakdown

Returns payload counts per resolution in the time range specified for all applications the current user owns

var params = {}; // all params are optional

// with callbacks
client.me.payloadCountsBreakdown(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.payloadCountsBreakdown(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, all.User.read, me.*, or me.payloadCountsBreakdown.

Available Parameters

Name Type Required Description Default Example
start string N Start of range for payload count query (ms since epoch) 0
end string N End of range for payload count query (ms since epoch) 1465790400000
resolution string N Resolution in milliseconds. Accepted values are: 86400000, 3600000 86400000 86400000
asBytes string N If the resulting stats should be returned as bytes false true
includeNonBillable string N If non-billable payloads should be included in the result false true
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Payload Counts Breakdown Sum of payload counts by date

Error Responses

Code Type Description
400 Error Error if malformed request

Refresh Token

Returns a new auth token based on the current auth token

var params = {}; // all params are optional

// with callbacks
client.me.refreshToken(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.refreshToken(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, or me.*.

Available Parameters

Name Type Required Description Default Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Authenticated User Successful token regeneration

Error Responses

Code Type Description
400 Error Error if malformed request
401 Error Unauthorized error if authentication fails

Respond to Invite

Accepts or rejects an invitation to an organization

var params = {
  inviteId: myInviteId,
  response: myResponse
};

// with callbacks
client.me.respondToInvite(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.respondToInvite(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.respondToInvite.

Available Parameters

Name Type Required Description Default Example
inviteId string Y ID associated with the invitation 575ec8687ae143cd83dc4a97
response Organization Invitation Action For User Y Response to invitation Organization Invitation Action For User Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Organization Invitation Result For User Acceptance or rejection of invitation

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if invitation not found
410 Error Error if invitation has expired

Transfer Resources

Moves resources to a new owner

var params = {
  transfer: myTransfer
};

// with callbacks
client.me.transferResources(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.transferResources(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.transferResources.

Available Parameters

Name Type Required Description Default Example
transfer Resource Transfer Y Object containing properties of the transfer Resource Transfer Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Success If resource transfer was successful

Error Responses

Code Type Description
400 Error Error if malformed request

Verify Email

Sends an email verification to the user

var params = {}; // all params are optional

// with callbacks
client.me.verifyEmail(params, function (err, result) {
  if (err) { return console.error(err); }
  console.log(result);
});

// with promises
client.me.verifyEmail(params)
  .then(console.log)
  .catch(console.error);

Authentication

The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.User, me.*, or me.verifyEmail.

Available Parameters

Name Type Required Description Default Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Success If email verification was successfully sent

Error Responses

Code Type Description
400 Error Error if malformed request