Get click

GET /v2/client/clicks/{clickId}

Returns the next action to take for the given click. It returns the user's current progress and either a redirect target or a question to answer.

Path parameters

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
    • data object

      Additional properties are allowed.

      Hide data attributes Show data attributes object
      • Additional properties are allowed.

        Hide answer_question attribute Show answer_question attribute object
        • question object Required

          Additional properties are allowed.

          Hide question attributes Show question attributes object
          • id string Required

            unique identifier of the question

          • language string(ISO 639-1) Required
          • type string Required

            Values are TEXT, SINGLE, MULTI, NUMBER, or DATE.

          • localized_text string Required
          • answers array[object] Required
            Hide answers attributes Show answers attributes object
          • can_skip boolean Required
          • is_duplicate boolean Required

            Indicates if a similar question was already asked to the user.

          • example string

            Optional example answer for this question.

          • Validation info for a question.

            • If regex is not null, every answer value must match the regex.
            • If the question is of type TEXT, this object will contain the min and max length of the answer.
            • If the question is of type NUMBER, this object will contain the min and max value of the answer.
            • If the question is of type DATE, this object will contain the min and max date of the answer. The BIRTHDATE question is a special case, min & max are the min and max age of the user.
            • If the question is of type SINGLE or MULTI, min and max will contain the min and max number of answers that the user can select.

            Additional properties are allowed.

            Hide validation_info attributes Show validation_info attributes object
      • redirect object

        Additional properties are allowed.

        Hide redirect attributes Show redirect attributes object
        • url string Required
        • type string Required

          termination = User terminated during the click and has to be redirected back. URL is taken from the app's settings. survey = User completed the click and can open the survey. URL is redirecting the user into the survey. start_bonus = User completed the start bonus and has to be redirected back. URL is taken from the app's settings.

          Values are termination, survey, or start_bonus.

      • answered_questions integer Required
      • required_questions integer Required
      • click_type string Required

        survey = this is a regular click; start_bonus = this is a start bonus click;

        Values are survey or start_bonus.

      • question_mode string Required

        default = this is a regular click; first = this is the first click with more questions than usual;

        Values are default or first.

      • survey_details object Required

        Additional properties are allowed.

        Hide survey_details attributes Show survey_details attributes object
        • id string Required
        • cpi string Required

          CPI of this survey in USD without any formatting applied.

        • value string Required

          CPI formatted according to your app settings. Can be shown to the user directly.

        • loi number(float) Required

          Assumed length of the survey in minutes

        • country string(ISO 3166-1 alpha-2) Required
        • language string(ISO 639-1) Required
        • rating integer Required

          Difficulty ranking of this survey. 1-5 (1 = hard, 5 = easy)

          Minimum value is 1, maximum value is 5.

        • category object Required

          Additional properties are allowed.

          Hide category attributes Show category attributes object
          • name string Required

            Localized category name

          • icon_name string Required
          • icon_url string Required

            If not empty: url to an icon for the category.

          • name_internal string Required

            Internal, un-localized, machine-friendly name of the category

GET /v2/client/clicks/{clickId}
curl \
 -X GET https://api.bitlabs.ai/v2/client/clicks/{clickId}
Response examples (200)
{
  "data": {
    "answer_question": {
      "question": {
        "id": "e9bdff4e7d",
        "language": "en",
        "type": "TEXT",
        "localized_text": "What is your favorite color?",
        "answers": [
          {
            "code": "1",
            "localized_text": "Red"
          }
        ],
        "can_skip": true,
        "is_duplicate": false,
        "example": "string",
        "validation_info": {
          "min": 1,
          "max": 1,
          "regex": "^.{1,30}$"
        }
      }
    },
    "redirect": {
      "url": "https://web.bitlabs.ai",
      "type": "termination"
    },
    "answered_questions": 42,
    "required_questions": 42,
    "click_type": "survey",
    "question_mode": "default",
    "survey_details": {
      "id": "string",
      "cpi": "1.2",
      "value": "120",
      "loi": 5.3,
      "country": "US",
      "language": "en",
      "rating": 4,
      "category": {
        "name": "Automotive",
        "icon_name": "string",
        "icon_url": "string",
        "name_internal": "automotive"
      }
    }
  }
}