Get Surveys

GET /v2/client/surveys

Returns a list of surveys that are available for the current user. This is the endpoint that should be used to display surveys to the user. If a simple integration flow is desired, this is the only endpoint that must be implemented. Redirecting to the click_url property of the returned surveys will open the survey in the BitLabs.

Query parameters

  • platform string Deprecated

    Platform/Device type of the user

    Values are MOBILE, TABLET, or WEB.

  • os string Deprecated

    Operating System of the user

    Values are ANDROID, IOS, or DESKTOP.

  • sdk string

    SDK the user is using

    Values are CUSTOM, IFRAME, TAB, NATIVE, UNITY, REACT, or FLUTTER.

  • tags string(URL-encoded query)

    Optional set of key-value pairs to be passed back in callbacks. Max 10 pairs with both key and value up to 50 characters long. Keys and values are trimmed and lower-cased. Keys can only contain alphanumeric characters and underscores. Values can contain any characters. If you need to pass sensitive information, note that users can potentially manipulate this data.

  • client_country string(ISO 3166-1 alpha-2)

    Allows overriding the country that is used for this request. This feature must be enabled by your account manager! If set, all other client_ parameters must be set as well.

  • Allows overriding the ip that is used for this request. This feature must be enabled by your account manager! If set, all other client_ parameters must be set as well.

  • Allows overriding the useragent that is used for this request. This feature must be enabled by your account manager! If set, all other client_ parameters must be set as well.

  • username string

    Allows specifying a display name for the requesting user which is used for features such as the leaderboard. Nothing happens if it is not set. Only alpha-numeric characters are allowed.

  • maid string

    optional mobile advertising id (MAID)

  • optional comma separated list of networks to exclude from the response

  • algo string

    Allows overriding the survey sorting algorithm configured for this app.

    Values are UX or QC.

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 restriction_reason attributes Show restriction_reason attributes object
        • The publisher account that owns this app has not been verified and therefore cannot receive surveys.

        • using_vpn boolean

          The user is using a VPN and cannot access surveys. This is the only endpoint that does not return HTTP 406 in this case.

        • banned_until string(RFC3339)

          It can happen that we ban users temporarily if we deem necessary. The time is in RFC3339 and represents the end of the ban.

        • reason string

          A translated reason for the ban.

        • In case users from a country that we do not offer surveys for are trying to access this endpoint.

      • surveys array[object] Required
        Hide surveys attributes Show surveys attributes object
        • id string Required
        • type string Required

          Values are survey or start_bonus.

        • click_url 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

        • tags array[string] Required

          recontact = this is a follow-up survey for specific users that completed a different survey before; pii = this survey might collect sensitive information from the user;

          Values are recontact or pii.

GET /v2/client/surveys
curl \
 -X GET https://api.bitlabs.ai/v2/client/surveys \
 -H "X-Api-Token: $API_KEY" \
 -H "X-User-Id: $API_KEY"
Response examples (200)
{
  "data": {
    "restriction_reason": {
      "not_verified": true,
      "using_vpn": true,
      "banned_until": "2020-05-04T17:01:30Z",
      "reason": "string",
      "unsupported_country": "string"
    },
    "surveys": [
      {
        "id": "string",
        "type": "survey",
        "click_url": "https://api.bitlabs.ai/v2/client/clicks?s=8689b6c0-e2ee-4321-a3ed-426739bc262f&i=96c1edd5-ece2-42f1-9927-405718e6dfbc",
        "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"
        },
        "tags": [
          "pii"
        ]
      }
    ]
  }
}