Campaigns

Create a single question.

  • Restricted to campaigns of type mission.

  • If there's a conflict in the question_number the request takes priority. If you add a question in position 1 in page 1 and there is already a question 1 in the page 1, the new question will be placed in position 1 and the one that already existed is moved to position 2 in page 1.

  • The page_number and question_number are adjusted to the current state. If i.e. the page_number does not exist, a new subsequent number will be given regardless of the input.

post/public/api/campaigns/{id}/questions

Request

  • Base URL
    https://<base_url>
  • Auth
    HTTP bearer

Headers

Acceptstring

e.g. application/json

Request body

questionstring
question_typestring
page_numbernumber
question_numbernumber

Example request

{
  "question": "Photo 2",
  "question_type": "photo",
  "page_number": 200,
  "question_number": 12,
  "question_attributes": {
    "allow_library": true,
    "hide_mobile": false,
    "mandatory": false
  }
}

Response

OK

campaign_idstring
created_datestring
updated_datestring
titlestring
descriptionstring
tagsstring[]
typestring
page_titlesstring[]
icon_urlstring
background_urlstring

Example response

{
  "campaign_id": "54ab03c6546847ee0d30086a",
  "created_date": "2021-05-23T04:45:02.020Z",
  "updated_date": "2021-05-23T04:51:40.862Z",
  "title": "Rockets campaign 1",
  "description": "campaign description here",
  "tags": [
    "tag1",
    "tag2"
  ],
  "type": "mission",
  "page_titles": [
    "Page 1"
  ],
  "icon_url": "https://res.cloudinary.com/www-yoobic-com/image/upload/a_exif/v1569401814/ji2yhtw926naemtsj6xr.png",
  "background_url": "https://res.cloudinary.com/www-yoobic-com/image/upload/a_exif/v1569401827/seuuqjbry1e4uusi0nta.png",
  "questions": [
    {
      "question_id": "e8335f8d-109d-475f-b10b-113ce6876dc7",
      "question_type": "number",
      "question": "number of ice-cream flavors",
      "page_number": 1,
      "question_number": 1
    },
    {
      "question_id": "e8335f8d-109d-475f-b10b-113ce6876dc8",
      "question_type": "text",
      "question": "ice-cream flavors",
      "page_number": 1,
      "question_number": 2
    },
    {
      "question_id": "e8345f6d-108d-445f-b90b-123ce6876bc9",
      "question": "Photo 2",
      "question_type": "photo",
      "page_number": 2,
      "question_number": 1,
      "question_attributes": {
        "allow_library": true,
        "hide_mobile": false,
        "mandatory": false
      }
    }
  ]
}

Changes