Skip to content

Latest commit

 

History

History
215 lines (160 loc) · 6.66 KB

credential.md

File metadata and controls

215 lines (160 loc) · 6.66 KB

Credential Actions

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

Contents

Delete

Deletes a credential

var params = {
  applicationId: myApplicationId,
  credentialId: myCredentialId
};

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

// with promises
client.credential.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.Application, all.Organization, all.User, credential.*, or credential.delete.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
credentialId string Y ID associated with the credential 575ec76c7ae143cd83dc4a96
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Success If credential was successfully deleted

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if credential was not found

Get

Retrieves information on a credential

var params = {
  applicationId: myApplicationId,
  credentialId: myCredentialId
};

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

// with promises
client.credential.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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, credential.*, or credential.get.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
credentialId string Y ID associated with the credential 575ec76c7ae143cd83dc4a96
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Credential credential information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if credential was not found

Linked Resources

Retrieves information on resources linked to a credential

var params = {
  applicationId: myApplicationId,
  credentialId: myCredentialId
};

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

// with promises
client.credential.linkedResources(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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, credential.*, or credential.linkedResources.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
credentialId string Y ID associated with the credential 575ec76c7ae143cd83dc4a96
includeCustomNodes string N If the result of the request should also include the details of any custom nodes referenced by returned workflows false true
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Credential Linked Resources Linked resource information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if credential was not found

Patch

Updates information about a credential

var params = {
  applicationId: myApplicationId,
  credentialId: myCredentialId,
  credential: myCredential
};

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

// with promises
client.credential.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.Application, all.Organization, all.User, credential.*, or credential.patch.

Available Parameters

Name Type Required Description Default Example
applicationId string Y ID associated with the application 575ec8687ae143cd83dc4a97
credentialId string Y ID associated with the credential 575ec76c7ae143cd83dc4a96
credential Credential Patch Y Object containing new properties of the credential Credential Patch Example
losantdomain string N Domain scope of request (rarely needed) example.com

Successful Responses

Code Type Description
200 Credential Updated credential information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if credential was not found