Launch Survey

You can launch a survey using the following POST request:

Request
POST  https://<host>/v1/surveys/p734001133800/launches HTTP/1.1
Accept: application/json
Authorization: Bearer <access_token>
{
    "mode": "test",
    "generationMode": "createNew",
    "enforceNewVersion": true
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json; charset=utf-8
Location: https://<host>/v1/surveys/p734001133800/launches/621
{
  "id": 621,
  "status": "queue",
  "links": {
    "self": "https://<host>/v1/surveys/p734001133800/launches/621",
    "all": "https://<host>/v1/surveys/p734001133800/launches",
    "cancel": "https://<host>/v1/surveys/p734001133800/launches/621/cancel"
  }
}

Getting information about all survey launches for a single survey

You can get information about all survey launches for any single survey by issuing the following GET request:

Request
GET  https://<host>/v1/surveys/p734001133800/launches HTTP/1.1
Accept: application/json
Authorization: Bearer <access_token>
Response
HTTP/1.1 200 Ok
Content-Type: application/json; charset=utf-8
{
  "itemType": "surveyLaunches",
  "itemCount": 3,
  "totalCount": 3,
  "items": [
    {
      "id": 603,
      "status": "complete",
      "links": {
        "self": "https://<host>/v1/surveys/p734001133800/launches/603"
      }
    },
    {
      "id": 611,
      "status": "complete",
      "links": {
        "self": "https://<host>/v1/surveys/p734001133800/launches/611"
      }
    },
    {
      "id": 621,
      "status": "complete",
      "links": {
        "self": "https://<host>/v1/surveys/p734001133800/launches/621"
      }
    }
  ],
  "links": {
    "all": "https://<host>/v1/surveys/p734001133800/launches"
  }
}

Get information about single survey launch

You can get extended information about single survey launch (including log items) with the following GET request:

Request
GET  https://<host>/v1/surveys/p734001133800/launches/621?LogTypes=all&MaxLogEntries=10 HTTP/1.1
Accept: application/json
Authorization: Bearer <access_token>
Response
HTTP/1.1 200 Ok
Content-Type: application/json; charset=utf-8
{
  "id": 621,
  "status": "complete",
  "logs": {
    "itemType": "surveyLaunchLogs",
    "itemCount": 10,
    "totalCount": 22,
    "items": [
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:39.51+00:00",
        "text": "Initiating task (Process): Launch Survey"
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:39.513+00:00",
        "text": "Assigned server: co-osl-devhv36 (1)"
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:47.74+00:00",
        "text": "Generating DB for project p734001133800..."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:52.787+00:00",
        "text": "Updating system tables..."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:55.9+00:00",
        "text": "Upgrading database..."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:57.247+00:00",
        "text": "Enabling Change Tracking..."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:57.26+00:00",
        "text": "Enabling Change Tracking for table 'HubLoadNotification'."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:57.273+00:00",
        "text": "Enabling Change Tracking for table 'respondent'."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:57.287+00:00",
        "text": "Enabling Change Tracking for table 'response_control'."
      },
      {
        "type": "info",
        "timeStamp": "2021-01-28T11:42:57.303+00:00",
        "text": "Enabling Change Tracking for table 'response0'."
      }
    ],
    "links": {}
  },
  "links": {
    "self": "https://<host>/v1/surveys/p734001133800/launches/621",
    "all": "https://<host>/v1/surveys/p734001133800/launches"
  }
}

You can read more about query string parameters for this request in the Swagger documentation.

Cancel survey launch

You have an ability to cancel any survey launch if it is not complete yet. Use the following POST request:

Request
POST https://<host>/v1/surveys/p734001133800/launches/621/cancel HTTP/1.1
Accept: application/json
Authorization: Bearer <access_token>
Response
HTTP/1.1 202 Accepted
Content-Type: application/json; charset=utf-8
{
  "id": 621,
  "status": "complete",
  "links": {
    "self": "https://<host>/v1/surveys/p734001133800/launches/621",
    "all": "https://<host>/v1/surveys/p734001133800/launches"
  }
}