POST v1/Surveys/{surveyId}/Sample

User roles allowed to make this request: DomainAdministrator PowerUser RegularUser LimitedUser SampleManager

Permissions required to make this request: SampleRecord.Write SampleRecord.Read Survey.Read

Has survey type usage restrictions online cati

Uploads the sample data for the specified survey. Pass the sample data as a CSV formatted string in the body of the request.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
surveyId

id of the survey

string

Required

Body Parameters

None.

Response Information

Resource Description

A result object representing the status of the upload operation

Response Message

SampleUploadStatus
NameDescriptionTypeAdditional information
ProcessingStatus

Description of the status of the upload operation

string

None.

TotalRecordCount

Total number of records contained in the request

integer

None.

InsertedCount

Number of records inserted as result of the operation

integer

None.

UpdatedCount

Number of records updated as result of the operation

integer

None.

DuplicateKeyCount

Number of records contained in the request that result in a duplicate key

integer

None.

EmptyKeyCount

Number of records contained in the request with no key

integer

None.

InvalidKeyCount

Number of records contained in the request with invalid key

integer

None.

InvalidDataCount

Number of invalid records contained in the request

integer

None.

SkippedCount

Number of records skipped during the operation

integer

None.

HeaderInvalid

True if the data posted with the request has an invalid header

boolean

None.

HeaderInvalidColumnsCount

Number of header columns invalid in the request's data

integer

None.

HeaderDataMismatch

True if the data in the request does not match the header

boolean

None.

ErrorMessages

Detailed error messages

Collection of UploadSampleRecordError

None.

Response Formats

application/json, text/json

Sample:
{
  "ProcessingStatus": "sample string 1",
  "TotalRecordCount": 2,
  "InsertedCount": 3,
  "UpdatedCount": 4,
  "DuplicateKeyCount": 5,
  "EmptyKeyCount": 6,
  "InvalidKeyCount": 7,
  "InvalidDataCount": 8,
  "SkippedCount": 9,
  "HeaderInvalid": true,
  "HeaderInvalidColumnsCount": 11,
  "HeaderDataMismatch": true,
  "ErrorMessages": [
    {
      "ErrorType": "sample string 1",
      "RowNumber": 2,
      "FieldName": "sample string 3",
      "FieldValue": "sample string 4"
    },
    {
      "ErrorType": "sample string 1",
      "RowNumber": 2,
      "FieldName": "sample string 3",
      "FieldValue": "sample string 4"
    }
  ]
}

application/xml, text/xml

Sample:
<SampleUploadStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NipoSoftware.Nfield.Manager.Api.Models">
  <DuplicateKeyCount>5</DuplicateKeyCount>
  <EmptyKeyCount>6</EmptyKeyCount>
  <ErrorMessages>
    <UploadSampleRecordError>
      <ErrorType>sample string 1</ErrorType>
      <FieldName>sample string 3</FieldName>
      <FieldValue>sample string 4</FieldValue>
      <RowNumber>2</RowNumber>
    </UploadSampleRecordError>
    <UploadSampleRecordError>
      <ErrorType>sample string 1</ErrorType>
      <FieldName>sample string 3</FieldName>
      <FieldValue>sample string 4</FieldValue>
      <RowNumber>2</RowNumber>
    </UploadSampleRecordError>
  </ErrorMessages>
  <HeaderDataMismatch>true</HeaderDataMismatch>
  <HeaderInvalid>true</HeaderInvalid>
  <HeaderInvalidColumnsCount>11</HeaderInvalidColumnsCount>
  <InsertedCount>3</InsertedCount>
  <InvalidDataCount>8</InvalidDataCount>
  <InvalidKeyCount>7</InvalidKeyCount>
  <ProcessingStatus>sample string 1</ProcessingStatus>
  <SkippedCount>9</SkippedCount>
  <TotalRecordCount>2</TotalRecordCount>
  <UpdatedCount>4</UpdatedCount>
</SampleUploadStatus>