Table of Contents

Class SurveysScriptsClient

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

Constructors

SurveysScriptsClient(string, HttpClient)

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

GetAsync(string, CancellationToken)

This method retrieves the ODIN script of a specific survey.

public virtual Task<SurveyGetScriptModel> GetAsync(string surveyId, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

cancellationToken CancellationToken

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

Returns

Task<SurveyGetScriptModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

GetEtagV2Async(string, string, CancellationToken)

This method retrieves the specific version of ODIN script for the specified survey.

public virtual Task<SurveyGetScriptModel> GetEtagV2Async(string surveyId, string eTag, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

eTag string

The version of the script to retrieve

cancellationToken CancellationToken

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

Returns

Task<SurveyGetScriptModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(string, SurveySetScriptModel, CancellationToken)

This method updates the ODIN script of a specific survey.

public virtual Task<SurveyGetScriptModel> PostAsync(string surveyId, SurveySetScriptModel script, CancellationToken cancellationToken = default)

Parameters

surveyId string

The id of the survey

script SurveySetScriptModel

The (odin) script for the survey

cancellationToken CancellationToken

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

Returns

Task<SurveyGetScriptModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

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

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

Type Parameters

T