Class SurveysDataClient
public class SurveysDataClient
- Inheritance
-
SurveysDataClient
- Inherited Members
Constructors
SurveysDataClient(string, HttpClient)
public SurveysDataClient(string baseUrl, HttpClient httpClient)
Parameters
baseUrlstringhttpClientHttpClient
Properties
BaseUrl
public string BaseUrl { get; set; }
Property Value
JsonSerializerSettings
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
- JsonSerializerSettings
ReadResponseAsString
public bool ReadResponseAsString { get; set; }
Property Value
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
surveyIdstringThe survey for which the download is requested
surveyDataRequestSurveyDataRequestModelThe information that the download should contain
cancellationTokenCancellationTokenA 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
surveyIdstringThe survey for which the download is requested
interviewIdintThe interview for which the download is requested
surveyDataInterviewRequestSurveyDataInterviewRequestModelThe information that the download should contain
cancellationTokenCancellationTokenA 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
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T