Table of Contents

Class DomainCapiInterviewersClient

Namespace
Nfield.SDK
Assembly
Nfield.Public.SDK.dll
public class DomainCapiInterviewersClient
Inheritance
DomainCapiInterviewersClient
Inherited Members

Constructors

DomainCapiInterviewersClient(string, HttpClient)

public DomainCapiInterviewersClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl string
httpClient HttpClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

string

JsonSerializerSettings

protected JsonSerializerSettings JsonSerializerSettings { get; }

Property Value

JsonSerializerSettings

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

bool

Methods

DeleteAsync(string, CancellationToken)

This method deletes a specified interviewer.

public virtual Task DeleteAsync(string interviewerId, CancellationToken cancellationToken = default)

Parameters

interviewerId string

The id of the interviewer that is to be deleted

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

No content

Exceptions

NfieldSdkException

A server side error occurred.

DeleteOfficeAssignmentAsync(string, string, CancellationToken)

Delete fieldwork office(s) from an interviewer. If fieldwork office doesn't exist on interviewer it will be ignored.

public virtual Task DeleteOfficeAssignmentAsync(string interviewerId, string officeId, CancellationToken cancellationToken = default)

Parameters

interviewerId string

Interviewer interviewerId

officeId string

fieldwork officeId

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

Fieldwork office removed

Exceptions

NfieldSdkException

A server side error occurred.

GetAllAsync(CancellationToken)

This method retrieve a list of interviewers. This list can be
filtered and sorted using standard OData syntax.

public virtual Task<ICollection<Interviewer>> GetAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<ICollection<Interviewer>>

Capi Interviewers

Exceptions

NfieldSdkException

A server side error occurred.

GetAssignmentsAsync(string, CancellationToken)

This method retrieves all assignments with counts for the interviewer. It is only allowed for CAPI surveys.
Gets all assignments types, Survey and Sampling points. (Free intercept, Individual target, Sampling points)

public virtual Task<ICollection<InterviewerAssignmentResponseModel>> GetAssignmentsAsync(string interviewerId, CancellationToken cancellationToken = default)

Parameters

interviewerId string

The id of the interviewer

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<ICollection<InterviewerAssignmentResponseModel>>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

GetAsync(string, CancellationToken)

This method retrieve details of a specific interviewer using the interviewerId.

public virtual Task<Interviewer> GetAsync(string interviewerId, CancellationToken cancellationToken = default)

Parameters

interviewerId string

The id of the interviewer

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<Interviewer>

Capi Interviewer

Exceptions

NfieldSdkException

A server side error occurred.

GetByClientIdAsync(string, CancellationToken)

This method retrieve the details of a specific interviewer using the clientInterviewerId.

public virtual Task<Interviewer> GetByClientIdAsync(string clientInterviewerId, CancellationToken cancellationToken = default)

Parameters

clientInterviewerId string

The ClientInterviewerId of the ClientInterviewer

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<Interviewer>

Capi Interviewer by ClientId

Exceptions

NfieldSdkException

A server side error occurred.

GetOfficesAsync(string, CancellationToken)

Returns fieldwork offices assigned to the specified interviewer.

public virtual Task<ICollection<string>> GetOfficesAsync(string interviewerId, CancellationToken cancellationToken = default)

Parameters

interviewerId string

Interviewer interviewerId

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<ICollection<string>>

Fieldwork offices

Exceptions

NfieldSdkException

A server side error occurred.

PatchAsync(string, EditCapiInterviewerRequestModel, CancellationToken)

Update an interviewer with the specified specified fields

public virtual Task<CapiInterviewerResponseModel> PatchAsync(string interviewerId, EditCapiInterviewerRequestModel interviewer, CancellationToken cancellationToken = default)

Parameters

interviewerId string

The id of the interviewer that is updated.

interviewer EditCapiInterviewerRequestModel

Supply Interviewer object with only the properties and values you would like to update: FirstName, LastName, EmailAddress, TelephoneNumber, IsSupervisor

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<CapiInterviewerResponseModel>

Capi Interviewer updated

Exceptions

NfieldSdkException

A server side error occurred.

PatchOfficeAssignmentAsync(string, string, CancellationToken)

Add fieldwork office to an interviewer. If fieldwork office already exist on interviewer it will be ignored.

public virtual Task PatchOfficeAssignmentAsync(string interviewerId, string officeId, CancellationToken cancellationToken = default)

Parameters

interviewerId string

Interviewer interviewerId

officeId string

FieldworkOffice Id

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

Fieldwork office added

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(NewCapiInterviewerRequestModel, CancellationToken)

This method creates a new interviewer.

public virtual Task<CapiInterviewerResponseModel> PostAsync(NewCapiInterviewerRequestModel interviewer, CancellationToken cancellationToken = default)

Parameters

interviewer NewCapiInterviewerRequestModel

An object describing the details for the new interviewer

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<CapiInterviewerResponseModel>

New Capi Interviewer

Exceptions

NfieldSdkException

A server side error occurred.

PutAsync(string, ResetPasswordModel, CancellationToken)

This method is used to reset an interviewer's password.

public virtual Task<CapiInterviewerResponseModel> PutAsync(string interviewerId, ResetPasswordModel resetPassword, CancellationToken cancellationToken = default)

Parameters

interviewerId string

The id of the interviewer to reset the password for

resetPassword ResetPasswordModel

An object containing the new password

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<CapiInterviewerResponseModel>

Capi Interviewer password updated

Exceptions

NfieldSdkException

A server side error occurred.

ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)

protected virtual Task<DomainCapiInterviewersClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)

Parameters

response HttpResponseMessage
headers IReadOnlyDictionary<string, IEnumerable<string>>
cancellationToken CancellationToken

Returns

Task<DomainCapiInterviewersClient.ObjectResponseResult<T>>

Type Parameters

T