Surveys Guide

Retrieve a List of Surveys

GET /api/v3/surveys/
Query Parameters:
 
  • search – a string to search for in the survey name.
  • group – id or name that the survey belongs to.
  • tags – tag name.
curl -u bob@example.com:PASSWORD https://fluidsurveys.com/api/v3/surveys/
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 346176,
      "name": "Demo Survey",
      "number_of_responses": 2,
      "survey_uri": "https://fluidsurveys.com/api/v3/surveys/346176/",
      "live": 1,
      "slug": "demo-survey",
      "creator": "https://fluidsurveys.com/api/v3/users/2127285426/",
      "created_at": "2013-11-05T20:37:07Z",
      "updated_at": "2013-11-05T20:37:21Z",
      "deploy_url": "http://fluidsurveys.com/surveys/api_bob/demo-survey/",
      "duplicate_uri": "https://fluidsurveys.com/api/v3/surveys/346176/duplicate/",
      "send_invite_uri": "https://fluidsurveys.com/api/v3/surveys/346176/invites/",
      "responses_uri": "https://fluidsurveys.com/api/v3/surveys/346176/responses/",
      "survey_settings_uri": "https://fluidsurveys.com/api/v3/surveys/346176/settings/",
      "survey_structure_uri": "https://fluidsurveys.com/api/v3/surveys/346176/structure/",
      "collectors_uri": "https://fluidsurveys.com/api/v3/surveys/346176/collectors/",
      "invite_codes_uri": "https://fluidsurveys.com/api/v3/surveys/346176/invite_codes/",
      "groups_uri": "https://fluidsurveys.com/api/v3/surveys/346176/groups/",
      "reports_uri": "https://fluidsurveys.com/api/v3/surveys/346176/reports/",
      "csv_uri": "https://fluidsurveys.com/api/v3/surveys/346176/csv/",
      "tags_uri": "https://fluidsurveys.com/api/v3/surveys/346176/tags/",
      "versions_uri": "https://fluidsurveys.com/api/v3/surveys/346176/versions/",
      "questions_uri": "https://fluidsurveys.com/api/v3/surveys/346176/questions/",
      "languages_uri": "https://fluidsurveys.com/api/v3/surveys/346176/languages/"
    }
  ]
}

Create a New Survey

POST /api/v3/surveys/

(* denotes required parameters)

Form Parameters:
 
  • name* – name of new survey
  • live0 (closed) or 1 (open)
curl -u bob@example.com:PASSWORD -d "name=My New Survey" \
https://fluidsurveys.com/api/v3/surveys/
{
  "id": 346290,
  "name": "My New Survey",
  "number_of_responses": 0,
  "survey_uri": "https://fluidsurveys.com/api/v3/surveys/346290/",
  "live": 1,
  "slug": "my-new-survey",
  "creator": "https://fluidsurveys.com/api/v3/users/2127285426/",
  "created_at": "2013-11-05T21:34:33.227Z",
  "updated_at": "2013-11-05T21:34:33.227Z",
  "deploy_url": "http://fluidsurveys.com/surveys/api_bob/my-new-survey/",
  "duplicate_uri": "https://fluidsurveys.com/api/v3/surveys/346290/duplicate/",
  "send_invite_uri": "https://fluidsurveys.com/api/v3/surveys/346290/invites/",
  "responses_uri": "https://fluidsurveys.com/api/v3/surveys/346290/responses/",
  "survey_settings_uri": "https://fluidsurveys.com/api/v3/surveys/346290/settings/",
  "survey_structure_uri": "https://fluidsurveys.com/api/v3/surveys/346290/structure/",
  "collectors_uri": "https://fluidsurveys.com/api/v3/surveys/346290/collectors/",
  "invite_codes_uri": "https://fluidsurveys.com/api/v3/surveys/346290/invite_codes/",
  "groups_uri": "https://fluidsurveys.com/api/v3/surveys/346290/groups/",
  "reports_uri": "https://fluidsurveys.com/api/v3/surveys/346290/reports/",
  "csv_uri": "https://fluidsurveys.com/api/v3/surveys/346290/csv/",
  "tags_uri": "https://fluidsurveys.com/api/v3/surveys/346290/tags/",
  "versions_uri": "https://fluidsurveys.com/api/v3/surveys/346290/versions/",
  "questions_uri": "https://fluidsurveys.com/api/v3/surveys/346290/questions/",
  "languages_uri": "https://fluidsurveys.com/api/v3/surveys/346290/languages/",
}

Edit a Survey

PUT /api/v3/surveys/:id/
Form Parameters:
 
  • name – name of new survey
  • live0 (closed) or 1 (open)
curl -u bob@example.com:PASSWORD -X PUT -d "name=new name" \
https://fluidsurveys.com/api/v3/surveys/346290/
{
  "id": 346290,
  "name": "new name",
  "number_of_responses": 0,
  "survey_uri": "https://fluidsurveys.com/api/v3/surveys/346290/",
  "live": 1,
  "slug": "my-new-survey",
  "creator": "https://fluidsurveys.com/api/v3/users/2127285426/",
  "created_at": "2013-11-05T21:34:33Z",
  "updated_at": "2013-11-06T20:25:18.039Z",
  "deploy_url": "http://fluidsurveys.com/surveys/api_bob/my-new-survey/",
  "duplicate_uri": "https://fluidsurveys.com/api/v3/surveys/346290/duplicate/",
  "send_invite_uri": "https://fluidsurveys.com/api/v3/surveys/346290/invites/",
  "responses_uri": "https://fluidsurveys.com/api/v3/surveys/346290/responses/",
  "survey_settings_uri": "https://fluidsurveys.com/api/v3/surveys/346290/settings/",
  "survey_structure_uri": "https://fluidsurveys.com/api/v3/surveys/346290/structure/",
  "collectors_uri": "https://fluidsurveys.com/api/v3/surveys/346290/collectors/",
  "invite_codes_uri": "https://fluidsurveys.com/api/v3/surveys/346290/invite_codes/",
  "groups_uri": "https://fluidsurveys.com/api/v3/surveys/346290/groups/",
  "reports_uri": "https://fluidsurveys.com/api/v3/surveys/346290/reports/",
  "csv_uri": "https://fluidsurveys.com/api/v3/surveys/346290/csv/",
  "tags_uri": "https://fluidsurveys.com/api/v3/surveys/346290/tags/",
  "versions_uri": "https://fluidsurveys.com/api/v3/surveys/346290/versions/",
  "questions_uri": "https://fluidsurveys.com/api/v3/surveys/346290/questions/",
  "languages_uri": "https://fluidsurveys.com/api/v3/surveys/346290/languages/"
}

Next up, check out out our guide to Dealing with Responses.