Table of Contents

Class SurveysDataClient

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

Constructors

SurveysDataClient(string, HttpClient)

public SurveysDataClient(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

PostAllAsync(string, SurveyDataRequestModel, CancellationToken)

Post a request for a data download.
The surveyDataRequest specifies the information required on the download.

public virtual Task<BackgroundActivityStatus> PostAllAsync(string surveyId, SurveyDataRequestModel surveyDataRequest, CancellationToken cancellationToken = default)

Parameters

surveyId string

The survey for which the download is requested

surveyDataRequest SurveyDataRequestModel

The information that the download should contain

cancellationToken CancellationToken

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

Returns

Task<BackgroundActivityStatus>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(string, int, SurveyDataInterviewRequestModel, CancellationToken)

Post a request for a data download of one interview.

public virtual Task<BackgroundActivityStatus> PostAsync(string surveyId, int interviewId, SurveyDataInterviewRequestModel surveyDataInterviewRequest, CancellationToken cancellationToken = default)

Parameters

surveyId string

The survey for which the download is requested

interviewId int

The interview for which the download is requested

surveyDataInterviewRequest SurveyDataInterviewRequestModel

The information that the download should contain

cancellationToken CancellationToken

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

Returns

Task<BackgroundActivityStatus>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

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

protected virtual Task<SurveysDataClient.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<SurveysDataClient.ObjectResponseResult<T>>

Type Parameters

T