Data¶
The DIY Surveys API 3.1 and later supports integration with custom data import features for a survey. In API 3.2 the operation is POST /v3.2/Data/Import; its generated contract is available in the Scalar reference.
Info
This feature requires an understanding of the data import and export capabilities of the DIY Surveys platform. Contact Client Support for more information.
Importing data¶
Imports data based on a survey custom import definition.
URL: base/Data/Import
Method: POST
{
"Reference": "SurveyReference/DataImportReference",
"List": [
{
"RequestID": "1234567890DEFED",
"MobileNumber": "44123456789",
"OrgID": 1010,
"Instance": "ETRERT",
"Campaign": 1242,
"TimeStamp": "2020-02-04T11:47:33.645773+00:00"
},
{
"RequestID": "1234567891DEFED",
"MobileNumber": "44123456781",
"OrgID": 1011,
"Instance": "ETRERT",
"Campaign": 1242,
"TimeStamp": "2020-02-04T11:47:33.645773+00:00"
}
]
}
Note
This is only an example of custom data. Coordinate with the person who set up the survey to agree the custom data to use when importing.
Parameters¶
| Name | Type | Description |
|---|---|---|
Reference |
Mandatory | Reference to the survey data import. Expected format: survey-reference/data-import-name. |
List |
Mandatory | One or more respondent records mapped to the survey import definition. |
Returns¶
The return structure is a list of the same length as the supplied list. Each entry contains a status and potentially standard data fields matching the supplied input.
For a successful import, the entry can contain:
| Field | Description |
|---|---|
Status |
A string containing Success. |
Title |
Respondent title, or blank. |
FirstName |
Respondent first name, or blank. |
LastName |
Respondent last name, or blank. |
MobileNumber |
Mobile number, or blank. |
EmailAddress |
Email address, or blank. |
Website |
Website, or blank. |
DateOfBirth |
Date of birth, or low value 1700-01-01 if absent. |
When |
Timestamp for when the invite should be sent. |
For a failure, Status describes the problem.
Example response:
[
{
"Status": "Success",
"Title": "",
"FirstName": "",
"LastName": "",
"MobileNumber": "44123456789",
"EmailAddress": "someone@gmail.com",
"Website": "",
"DateOfBirth": "1700-01-01T00:00:00.000000",
"When": "2025-07-14T09:19:18.12323223Z"
},
{
"Status": "OverQuota"
}
]
HTTP statuses¶
| Status | Description |
|---|---|
| 400 | Reference is required for import. |
| 400 | No data provided for import. |
| 400 | Invalid reference format. Expected survey-reference/data-import-name. |
| 400 | All or some data was invalid. Check the response for details. |
| 404 | Survey with the specified unique reference was not found. |
| 404 | Process with the specified unique name was not found. |
| 404 | Process does not belong to the survey. Contact DIY Surveys Client Support. |
| 400 | Failed to initialize the import process. |
| 400 | An error occurred during the import process, but no specific errors were logged. |