JobsManager

management. JobsManager

Abstract the creation as well as the retrieval of async jobs.

Constructor

new JobsManager(options)

Source:
Parameters:
Name Type Description
options Object

The client options.

Name Type Attributes Description
baseUrl String

The URL of the API.

headers Object <optional>

Headers to be included in all requests.

retry Object <optional>

Retry Policy Config

Members

(inner) auth0RestClient :external:RestClient

Provides an abstraction layer for consuming the Jobs endpoint.

Source:
Type:

Methods

get(params, cbopt) → {Promise|undefined}

Get a job by its ID.

Source:
Parameters:
Name Type Attributes Description
params Object

Job parameters.

Name Type Description
id String

Job ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  id: '{JOB_ID}'
};

management.jobs.get(params, function (err, job) {
  if (err) {
    // Handle error.
  }

  // Retrieved job.
  console.log(job);
});

importUsers(data, cbopt) → {Promise|undefined}

Given a path to a file and a connection id, create a new job that imports the users contained in the file and associate them with the given connection.

Source:
Parameters:
Name Type Attributes Description
data Object

Users import data.

Name Type Description
connectionId String

Connection for the users insertion.

users String

Path to the users data file.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  connection_id: '{CONNECTION_ID}',
  users: '{PATH_TO_USERS_FILE}'
};

management.jobs.get(params, function (err) {
  if (err) {
    // Handle error.
  }
});

verifyEmail(data, cbopt) → {Promise|undefined}

Send a verification email to a user.

Source:
Parameters:
Name Type Attributes Description
data Object

User data object.

Name Type Description
user_id String

ID of the user to be verified.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
	user_id: '{USER_ID}'
};

management.jobs.verifyEmail(function (err) {
  if (err) {
    // Handle error.
  }
});