Common Models

The following is an example of a completed Export Job.

{
    "exportJobId": 999888,
    "exportJobGuid": "7B623929-05DA-4356-BF30-EF7D1BB0248C",
    "savedListId": 1234,
    "webhookUrl": "https://webhook.example.org/completedExportJobs",
    "downloadUrl": "https://ngpvan.blob.core.windows.net/completed-export-jobs/7B623929-05DA-4356-BF30-EF7D1BB0248C_2017-01-01T12:00:00.csv",
    "status": "Completed",
    "type": 777,
    "dateExpired": "2017-01-04T12:00:00Z",
    "errorCode": null,
    "surveyQuestions": [ { "surveyQuestionId": 1234 } ],
    "activistCodes": [ { "activistCodeId": 4567 } ],
    "customFields": [ { "customFieldId": 5678 } ],
    "districtFields": [ { "districtFieldId": 10 } ]
}

Export Job

PropertyTypeDescription
exportJobIdintRead-only; Unique identifier for an Export Job
exportJobGuidstringRead-only; Globally unique identifier for an Export Job
savedListIdintThe Saved List containing People who are to be exported. This Saved List must be available to the API - i.e. it must be available via GET /savedLists.
webhookUrlstringThe URL to be notified when the Export Job has completed
downloadUrlstringRead-only; The URL where the completed Export Job may be downloaded. Will be null unless status is Completed.
statusstringRead-only; The status of the Export Job; may be Requested, Pending, Completed, or Error
typeintThe type of Export Job, indicating the columns to provide about the People in the Saved List. Contact us at [email protected] to determine the appropriate type. Note that while the list of columns provided with an Export Job type is static, some columns may be blank in certain contexts due to lack of availability.
dateExpireddatetimeRead-only; The date when the download URL expires.
errorCodestringRead-only; a reference for any error which occurred during the processing of the Export Job. Will be null unless status is Error.
surveyQuestionsarrayWrite-only; an array of objects, each containing a surveyQuestionId indicating a Survey Question whose response should be added to the file for each person in the Export Job. The column heading for these responses will be of the form SurveyQuestion_1234, and the value in each row will be of the form 2345, where 1234 and 2345 are the Survey Question ID and Survey Question Response ID, respectively. See Note below for important caveats.
activistCodesarrayWrite-only; an array of objects, each containing an activistCodeId indicating an Activist Code whose response should be added to the file for each person in the Export Job. The column heading for these responses will be of the form ActivistCode_4567, where 4567 is the Activist Code ID; for those people who have had the Activist Code applied, the value in each row will be 4567, and for those who have not had it applied, the value will be blank. See Note below for important caveats.
customFieldsarrayWrite-only; an array of objects, each containing a customFieldId indicating a Custom Field whose value should be added to the file for each person in the Export Job. The column heading for these responses will be of the form CustomField_5678, where 5678 is the Custom Field ID. Custom Fields requested via an export job must be marked as exportable. See Note below for important caveats.
districtFieldsarrayWrite-only; an array of objects, each containing a districtFieldId indicating a District Field whose value should be added to the file for each person in the Export Job. The column heading for these responses will be of the form DistrictField_10, and the value in each row will be of the form 111, where 10 and 111 indicate the District Field ID and District Field Value ID, respectively. See Note below for important caveats.

🚧

Note about Survey Questions, Activist Codes, Custom Fields and District Fields

Please note the following caveats about using these properties:

  1. Use of these properties requires special permissions, please contact us if you think you will need these properties.
  2. No more than ten such elements total may be requested per Export Job.
  3. No more than five elements of any type may be requested per Export Job.

For example, it is valid to request three Survey Questions and three Activist Codes, but it is not valid to request six Activist Codes in a single Export Job; or to request three Survey Questions, three Activist Codes, three Custom Fields, and three District Fields in a single Export Job.