Table of Contents

Class SurveysRespondentDataEncryptClient

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

Constructors

SurveysRespondentDataEncryptClient(string, HttpClient)

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

PostAsync(string, RespondentDataCryptographyModel, CancellationToken)

Gets asynchronously the decrypted data to encrypt it

public virtual Task<string> PostAsync(string surveyId, RespondentDataCryptographyModel respondentDataModel, CancellationToken cancellationToken = default)

Parameters

surveyId string

The survey identifier

respondentDataModel RespondentDataCryptographyModel

The decrypted text in modeled RespondentDataCryptographyModel object format and it's, optional, initialization vector.
The model in JSON format must look like {"Iv": "XXXXXXX","Data":{"Data1":"Value1","Data2":"Value2", "Data3":"Value3"}}

cancellationToken CancellationToken

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

Returns

Task<string>

Successful

Remarks

Request parameter keys should be capitalized, i.e, Data and Iv, otherwise it won't be validated

Exceptions

NfieldSdkException

A server side error occurred.

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

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

Type Parameters

T