Table of Contents

Class JobsClient

Namespace
Auth0.ManagementApi.Clients
Assembly
Auth0.ManagementApi.dll

Contains methods to access the /jobs endpoints.

public class JobsClient : BaseClient, IJobsClient
Inheritance
JobsClient
Implements
Inherited Members

Constructors

JobsClient(IManagementConnection, Uri, IDictionary<string, string>)

Initializes a new instance on JobsClient

public JobsClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)

Parameters

connection IManagementConnection

IManagementConnection used to make all API calls.

baseUri Uri

Uri of the endpoint to use in making API calls.

defaultHeaders IDictionary<string, string>

Dictionary containing default headers included with every request this client makes.

Methods

ExportUsersAsync(UsersExportsJobRequest, CancellationToken)

Exports users from a connection to a file using a long running job.

public Task<Job> ExportUsersAsync(UsersExportsJobRequest request, CancellationToken cancellationToken = default)

Parameters

request UsersExportsJobRequest

The UsersExportsJobRequest containing the information for the job to export users.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Job>

A Job instance containing the information about the job.

Remarks

The documentation for user exports can be found here.

GetAsync(string, CancellationToken)

Gets a job.

public Task<Job> GetAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The ID of the job to retrieve.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Job>

A Job instance containing the information about the job.

Remarks

This is useful to check the status of a job.

ImportUsersAsync(string, string, Stream, bool?, string, bool?, CancellationToken)

Imports users to a connection from a file using a long running job.

public Task<Job> ImportUsersAsync(string connectionId, string fileName, Stream file, bool? upsert = null, string externalId = null, bool? sendCompletionEmail = null, CancellationToken cancellationToken = default)

Parameters

connectionId string

The connection identifier.

fileName string

Name of the file.

file Stream

The file.

upsert bool?

Whether to update the user if already exists.

externalId string

Customer-defined id.

sendCompletionEmail bool?

Whether to send the user an email on import completion (true) or not (false).

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Job>

A Job instance containing the information about the job.

Remarks

The documentation for the file format is here.

SendVerificationEmailAsync(VerifyEmailJobRequest, CancellationToken)

Send an email to the specified user that asks them to click a link to verify their email address.

public Task<Job> SendVerificationEmailAsync(VerifyEmailJobRequest request, CancellationToken cancellationToken = default)

Parameters

request VerifyEmailJobRequest

The VerifyEmailJobRequest containing the information of the user whose email you want verified.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<Job>

A Job instance containing the information about the job.