Back to Top

BitLabs' public API to be integrated by our own products as well as publishers who desire maximum customization.

For 99% of publishers, the following endpoints are the only ones that must be implemented. Everything is optional and
only required if more advanced behaviour is desired:

  • GET /client/actions
  • POST /client/networks/{networkId}/questions/{questionId}
  • DELETE /client/user

NOTE: opening a survey should only be done by using the link property from surveys returned by GET /client/actions. Manually
creating these links and calling the GET /client/networks/{networkId}/surveys/{surveyId}/open endpoint will lead to issues.
The endpoint is only documented for completness and to understand its behaviour. Do NOT use it manually!

All endpoints optionally accepts a X-Mparticle-Session-Id header to sync a client mparticle session id for the requesting
user with the backend.

This is the documentation for version 1.0.40 of the API. Last update on Jun 22, 2022.

Base URL
https://api.bitlabs.ai/v1

The API accepts 2 different authentication methods:

Header api token (http_api_key)

ApiToken of your BitLabs app.

Query api token (http_api_key)

ApiToken of your BitLabs app.


Get Actions

GET /client/actions

Get Actions is the main endpoint that returns the next actions a user can perform. This can be a list of
surveys the user can open or qualifications (i.e. questions) the user still has to answer before we can
return more surveys.

If surveys are returned, they are ordered by what we think is the best value for the user. To join a survey,
use the link property of this reponse and open it in a browser. The user will be redirected from there.
When a survey is completed or a screenout happend, the user is redirected to the sites you specified on
your app's dashboard.

If a qualification is returned the user can answer it to potentially get more surveys. This endpoint returns
all information to display the question to the user. To answer it, look at POST /client/networks/{networkId}/questions/{questionId}.
After answering a question, call the Actions endpoint again to get updated results.

Query parameters
  • platform Required / string

    Platform/Device type of the user

    Values are MOBILE, TABLET, or WEB.

  • os string

    Operating System of the user

    Values are ANDROID, IOS, or DESKTOP.

  • sdk string

    SDK the user is using

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

  • optional fingerprint for survey filtering

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

  • client_ip string

    Allows overriding the ip that is used for this request. This feature must be enabled by your account manager!

Responses
  • 200 object

    OK

    • data object
      • is_new_user Required / boolean

        Is true until the user joins their first survey.

      • start_bonus object
        • not_verified boolean

          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
        • In case users from a country that we do not offer surveys for are trying to access this endpoint.

      • surveys Required / array[object]
        • network_id Required / integer

          ID of the network. Required in survey specific requests.

        • id Required / integer(int64)

          ID of the survey. Required in survey specific requests. This int is represented as a string because it may become an int64 at some point.

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

          Some surveys may have 'xx' as their language. This is a valid code in our case and indicates that the survey is available for all languages in the given country.

        • cpi Required / string

          CPI of this survey in USD without any formatting applied.

        • value Required / string

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

        • loi Required / number(float)

          Assumed length of the survey in minutes

        • remaining Required / integer

          Amount of users that can still open the survey

        • details Required / object
          • category Required / object
            • name Required / string

              Localized category name

            • icon_url Required / string

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

            • name_internal Required / string

              Internal, unlocalized, machine-friendly name of the category

          • network Required / object
            • name Required / string

              Displayable name of the network the survey came from

            • icon_url Required / string

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

          • difficulty Required / string Deprecated

            Is the difficulty rating for this survey

            Values are EASY, MEDIUM, or HARD.

        • rating Required / integer

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

          Minimum value is 1, maximum value is 5.

        • tags Required / array[string]

          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;
          recruitment = an offer recruiting users for external use;

          Values are recontact, pii, or recruitment.

        • test_group_id Required / integer
        • score Required / number(float)

          The survey's score determined by the ranking algorithm.

        • sequence Required / integer

          The index of this action item in spacial relation to all other action items. Can be used to order surveys and qualifications.

        • The amount of questions that have to be answered before the survey is guaranteed to be openable by the user.
          If the number is larger than zero, next_missing_question contains the next question to ask the user. This
          property might be unpopulated if the feature is not enabled for your app.

          • network_id Required / integer

            ID of the network. Required in question specific requests. 0 in this case is a valid network_id can be passed to our servers for getting/answering questions.

          • id Required / string

            The id of the question the user has to answer. Note that this is a string not an integer!

          • country Required / string(ISO 3166-1 alpha-2)
          • language Required / string(ISO 639-1)
          • type Required / string

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

          • localized_text Required / string
          • answers Required / array[object]
          • can_skip Required / boolean
      • qualification object
        • network_id Required / integer

          ID of the network. Required in question specific requests. 0 in this case is a valid network_id can be passed to our servers for getting/answering questions.

        • question_id Required / string

          The id of the question the user has to answer. Note that this is a string not an integer!

        • country Required / string(ISO 3166-1 alpha-2)
        • language Required / string(ISO 639-1)
        • question Required / object
          • network_id Required / integer

            ID of the network. Required in question specific requests. 0 in this case is a valid network_id can be passed to our servers for getting/answering questions.

          • id Required / string

            The id of the question the user has to answer. Note that this is a string not an integer!

          • country Required / string(ISO 3166-1 alpha-2)
          • language Required / string(ISO 639-1)
          • type Required / string

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

          • localized_text Required / string
          • answers Required / array[object]
          • can_skip Required / boolean
        • is_standard_profile Required / boolean

          Flag is true if this question is asked because of our standard user profile that is asked for every user before we can filter surveys.

        • is_start_bonus Required / boolean

          Flag is true if this is part of the questions being asked until the user recieves their start bonus reward.

        • score Required / number(float)

          The score of the question's survey, determined by the ranking algorithm.

        • sequence Required / integer

          The index of this action item in spacial relation to all other action items. Can be used to order surveys and qualifications.

    • error object
    • status Required / string

      Values are success or error.

    • trace_id Required / string
GET /client/actions
curl \
 -X GET https://api.bitlabs.ai/v1/client/actions?platform=MOBILE&token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "is_new_user": true,
    "start_bonus": {
      "reward": "string"
    },
    "restriction_reason": {
      "not_verified": true,
      "using_vpn": true,
      "banned_until": "2020-05-04 17:01:30 UTC",
      "reason": "string",
      "unsupported_country": "string"
    },
    "surveys": [
      {
        "network_id": 42,
        "id": 42,
        "country": "string",
        "language": "string",
        "cpi": "string",
        "value": "string",
        "loi": 42.0,
        "remaining": 42,
        "details": {
          "category": {
            "name": "string",
            "icon_url": "string",
            "name_internal": "string"
          },
          "network": {
            "name": "string",
            "icon_url": "string"
          },
          "difficulty": "EASY"
        },
        "rating": 42,
        "tags": [
          "recontact"
        ],
        "test_group_id": 42,
        "link": "string",
        "score": 42.0,
        "sequence": 42,
        "missing_questions": 42,
        "next_missing_question": {
          "network_id": 42,
          "id": "string",
          "country": "US",
          "language": "en",
          "type": "TEXT",
          "localized_text": "string",
          "answers": [
            {
              "code": "string",
              "localized_text": "string"
            }
          ],
          "can_skip": true
        }
      }
    ],
    "qualification": {
      "network_id": 42,
      "question_id": "string",
      "country": "US",
      "language": "en",
      "question": {
        "network_id": 42,
        "id": "string",
        "country": "US",
        "language": "en",
        "type": "TEXT",
        "localized_text": "string",
        "answers": [
          {
            "code": "string",
            "localized_text": "string"
          }
        ],
        "can_skip": true
      },
      "is_standard_profile": true,
      "is_start_bonus": true,
      "score": 42.0,
      "sequence": 42
    }
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}

Check surveys

GET /client/check

The endpoint is similar to GET /client/actions as it returns if the user can perform an action (either opening
a survey or answering qualifications). It is faster than the actual Actions endpoint because it leaves out
additional information fetching. If you want to perform background checks if surveys are available, this is the
best option.

Query parameters
  • platform Required / string

    Platform/Device type of the user

    Values are MOBILE, TABLET, or WEB.

  • os string

    Operating System of the user

    Values are ANDROID, IOS, or DESKTOP.

  • sdk string

    SDK the user is using

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

  • optional fingerprint for survey filtering

Responses
GET /client/check
curl \
 -X GET https://api.bitlabs.ai/v1/client/check?platform=MOBILE&token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "has_surveys": true
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Responses
  • 200 object

    OK

    • data object
      • offers Required / array[object]
        • id Required / integer(int64)
        • title Required / string
        • description Required / string
        • icon Required / string
        • image string
        • is_live Required / boolean
        • target_os Required / array[string]

          Values are all, android, ios, or desktop.

        • tasks Required / array[object]
          • id Required / integer(int64)
          • description Required / string
          • cpa Required / string

            CPI of this survey in USD without any formatting applied.

          • value Required / string

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

          • is_live Required / boolean
          • completed_at string(date-time)
        • score Required / number(float)

          The offers's score determined by the ranking algorithm. Higher is better.

        • opened_at string(date-time)
        • completed_at string(date-time)
        • duration number(float)

          The average duration for offer completion in minutes

    • error object
    • status Required / string

      Values are success or error.

    • trace_id Required / string
GET /client/offers
curl \
 -X GET https://api.bitlabs.ai/v1/client/offers?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "offers": [
      {
        "id": 42,
        "title": "string",
        "description": "string",
        "icon": "string",
        "image": "string",
        "link": "string",
        "is_live": true,
        "target_os": [
          "all"
        ],
        "tasks": [
          {
            "id": 42,
            "description": "string",
            "cpa": "string",
            "value": "string",
            "is_live": true,
            "completed_at": "2022-01-01T12:00:00Z"
          }
        ],
        "score": 42.0,
        "opened_at": "2022-01-01T12:00:00Z",
        "completed_at": "2022-01-01T12:00:00Z",
        "duration": 42.0
      }
    ]
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}

Validate zipcode

GET /client/zipcodes/{zipcode}/valid
Path parameters
  • zipcode Required / string

    A path-encoded zipcode. We validate it against rules for the country the request is coming from.

Responses
GET /client/zipcodes/{zipcode}/valid
curl \
 -X GET https://api.bitlabs.ai/v1/client/zipcodes/{zipcode}/valid
Response example (200)
{
  "data": {
    "valid": true
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Get network privacy policy

GET /client/networks/{networkId}/privacy
Path parameters
Responses
  • 307

    Redirect

GET /client/networks/{networkId}/privacy
curl \
 -X GET https://api.bitlabs.ai/v1/client/networks/{networkId}/privacy

Get QuestionDeprecated

GET /client/networks/{networkId}/questions/{questionId}
Path parameters
Query parameters
  • country Required / string(ISO 3166-1 alpha-2)

    country of the survey

  • language Required / string(ISO 639-1)

    language of the survey

Responses
  • 200 object

    OK

    • data object
      • network_id Required / integer

        ID of the network. Required in question specific requests. 0 in this case is a valid network_id can be passed to our servers for getting/answering questions.

      • id Required / string

        The id of the question the user has to answer. Note that this is a string not an integer!

      • country Required / string(ISO 3166-1 alpha-2)
      • language Required / string(ISO 639-1)
      • type Required / string

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

      • localized_text Required / string
      • answers Required / array[object]
      • can_skip Required / boolean
    • error object
    • status Required / string

      Values are success or error.

    • trace_id Required / string
  • 406 object

    VPN detected

GET /client/networks/{networkId}/questions/{questionId}
curl \
 -X GET https://api.bitlabs.ai/v1/client/networks/{networkId}/questions/{questionId}?country=US&language=en&token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "network_id": 42,
    "id": "string",
    "country": "US",
    "language": "en",
    "type": "TEXT",
    "localized_text": "string",
    "answers": [
      {
        "code": "string",
        "localized_text": "string"
      }
    ],
    "can_skip": true
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Set question answer

POST /client/networks/{networkId}/questions/{questionId}

This endpoint store the answer for a question in the requesting user's profile. It also performs validation on
the input data:

  • at least one answer value has to be given
  • only MULTI questions support multiple answer values
  • all answers value must be strings, regardless of their value

Some questions have selectable answer options. Every option's code property, that is selected by the user,
must be passed as a single answer value in this request.

If a question does not have answer options (for example TEXT or NUMBER questions), pass the answer of
the user as a single element into the answer array for the endpoint.

After submitting an answer, you most likely want to call GET /client/actions again to get updated results.

Path parameters
Body Required
Responses
POST /client/networks/{networkId}/questions/{questionId}
curl \
 -X POST https://api.bitlabs.ai/v1/client/networks/{networkId}/questions/{questionId}?token=api_token_value \
 -H "X-Api-Token: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"answers":["string"]}'
Request example
{
  "answers": [
    "string"
  ]
}
Response example (200)
{
  "data": {},
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Skip question

POST /client/networks/{networkId}/questions/{questionId}/skip

Non standard profile questions (network id != 0) can be skipped if the user wants to. This is a permanent
operation and the user will never be asked the question again. Use this feature with caution as it can
significantly reduce the amount of surveys a user receives when used extensively.

Path parameters
Responses
POST /client/networks/{networkId}/questions/{questionId}/skip
curl \
 -X POST https://api.bitlabs.ai/v1/client/networks/{networkId}/questions/{questionId}/skip?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {},
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Skip survey

POST /client/networks/{networkId}/surveys/{surveyId}/skip
Path parameters
Responses
POST /client/networks/{networkId}/surveys/{surveyId}/skip
curl \
 -X POST https://api.bitlabs.ai/v1/client/networks/{networkId}/surveys/{surveyId}/skip?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {},
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Check Survey

GET /client/networks/{networkId}/surveys/{surveyId}/check
Path parameters
Query parameters
  • platform Required / string

    Platform/Device type of the user

    Values are MOBILE, TABLET, or WEB.

  • os string

    Operating System of the user

    Values are ANDROID, IOS, or DESKTOP.

  • sdk string

    SDK the user is using

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

  • optional fingerprint for survey filtering

  • sc_token string

    optional token for survey deduplication

Responses
GET /client/networks/{networkId}/surveys/{surveyId}/check
curl \
 -X GET https://api.bitlabs.ai/v1/client/networks/{networkId}/surveys/{surveyId}/check?platform=MOBILE&token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "can_open": true
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Open survey

GET /client/networks/{networkId}/surveys/{surveyId}/open
Path parameters
Query parameters
  • platform Required / string

    Platform/Device type of the user

    Values are MOBILE, TABLET, or WEB.

  • os string

    Operating System of the user

    Values are ANDROID, IOS, or DESKTOP.

  • sdk string

    SDK the user is using

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

  • rating Required / integer

    rating of the survey when the user opened it

  • cr Required / integer

    estimated conversion rate of the survey

  • loi Required / integer

    estimated length of the survey

  • cpi Required / string

    revenue in dollar for this survey

  • test_group integer

    optional test group id

  • tags string(URL-encoded query)

    optional set of custom tags

  • data string(URL-encoded query)

    optional set of internal information

  • maid string

    optional mobile advertising id (MAID)

  • hash Required / string

    url hash (for security reasons)

Responses
GET /client/networks/{networkId}/surveys/{surveyId}/open
curl \
 -X GET https://api.bitlabs.ai/v1/client/networks/{networkId}/surveys/{surveyId}/open?platform=MOBILE&rating=42&cr=42&loi=42&cpi=string&hash=string&token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Continue survey

POST /client/networks/{networkId}/surveys/{surveyId}/continue/{txId}
Path parameters
Body Required
Responses
POST /client/networks/{networkId}/surveys/{surveyId}/continue/{txId}
curl \
 -X POST https://api.bitlabs.ai/v1/client/networks/{networkId}/surveys/{surveyId}/continue/{txId}?token=api_token_value \
 -H "X-Api-Token: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"sc":{"search_token":"string","activity_token":"string","review":{"token":"string","q_id":42,"text":"string","c_text":"string","t_page_load":"string","t_text_typed":"string","t_submit":"string"}},"cid":{"token":"string","request_id":"string","os":"string","browser":"string","platform":"string","device_id":"string","hardware_name":"string","hardware_model":"string","hardware_vendor":"string","markers":{"is_event_unique":true,"is_sub_event_unique":true,"is_known_user_agent":true,"is_known_browser":true,"is_obsolete_browser":true,"is_known_os":true,"is_obsolete_os":true,"is_known_device_type":true,"is_known_domain":true,"is_bot":true,"is_blacklisted":true,"is_tampered":true,"is_anonymous":true,"is_resist":true,"is_velocity":true,"is_oscillating":true,"is_lang":true,"is_geo_lang":true,"is_geo_os_lang":true,"is_geo_tz":true,"is_geo_country":true,"is_geo_postal":true,"is_geo_off_hrs":true,"invalid_count":42,"score":42,"anonymous_reason":[42],"tampered_reason":[42],"postal_reason":[42]}}}'
Request example
{
  "sc": {
    "search_token": "string",
    "activity_token": "string",
    "review": {
      "token": "string",
      "q_id": 42,
      "text": "string",
      "c_text": "string",
      "t_page_load": "string",
      "t_text_typed": "string",
      "t_submit": "string"
    }
  },
  "cid": {
    "token": "string",
    "request_id": "string",
    "os": "string",
    "browser": "string",
    "platform": "string",
    "device_id": "string",
    "hardware_name": "string",
    "hardware_model": "string",
    "hardware_vendor": "string",
    "markers": {
      "is_event_unique": true,
      "is_sub_event_unique": true,
      "is_known_user_agent": true,
      "is_known_browser": true,
      "is_obsolete_browser": true,
      "is_known_os": true,
      "is_obsolete_os": true,
      "is_known_device_type": true,
      "is_known_domain": true,
      "is_bot": true,
      "is_blacklisted": true,
      "is_tampered": true,
      "is_anonymous": true,
      "is_resist": true,
      "is_velocity": true,
      "is_oscillating": true,
      "is_lang": true,
      "is_geo_lang": true,
      "is_geo_os_lang": true,
      "is_geo_tz": true,
      "is_geo_country": true,
      "is_geo_postal": true,
      "is_geo_off_hrs": true,
      "invalid_count": 42,
      "score": 42,
      "anonymous_reason": [
        42
      ],
      "tampered_reason": [
        42
      ],
      "postal_reason": [
        42
      ]
    }
  }
}
Response example (200)
{
  "data": {
    "link": "string"
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}

Leave survey

POST /client/networks/{networkId}/surveys/{surveyId}/leave

Usually, we handle completes and screenouts of users. Nontheless, it may happen that a user wants to leave a
survey before it was terminated. In this case, you can report the leave using this endpoint with a reason given
by the user. This endpoint is optional but we use the feedback in real-time to filter out bad surveys to
improve the overall UX for all users.

Path parameters
Body Required
  • reason Required / string

    Values are OTHER, TECHNICAL, SENSITIVE, TOO_LONG, or UNINTERESTING.

Responses
POST /client/networks/{networkId}/surveys/{surveyId}/leave
curl \
 -X POST https://api.bitlabs.ai/v1/client/networks/{networkId}/surveys/{surveyId}/leave?token=api_token_value \
 -H "X-Api-Token: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"reason":"OTHER"}'
Request example
{
  "reason": "OTHER"
}
Response example (200)
{
  "data": {},
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Open offer

GET /client/offers/{offerId}/open
Path parameters
  • offerId Required / integer(int64)
Query parameters
  • maid string

    optional mobile advertising id (MAID)

Responses
GET /client/offers/{offerId}/open
curl \
 -X GET https://api.bitlabs.ai/v1/client/offers/{offerId}/open?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Get user history

GET /client/user/history

Get User History returns a sorted list of events where the first element is the most recent. It contains up to
four different types of events: OPEN, LEAVE, SCREENOUT, COMPLETE.

Events in this response are unique per survey so if a survey was completed, only the complete event is returned
and not the corresponding opening. Only non open events contain a duration property. Only screenout and complete
events contain a user value property.

Responses
GET /client/user/history
curl \
 -X GET https://api.bitlabs.ai/v1/client/user/history?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": [
    {}
  ],
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Get user data

GET /client/user/data

Returns GDPR user data of the requesting user in a JSON format.

Responses
GET /client/user/data
curl \
 -X GET https://api.bitlabs.ai/v1/client/user/data?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "id": {
      "app_id": 42,
      "uid": "string"
    },
    "user_data": {
      "current_country": "US",
      "main_language": "en",
      "spoken_languages": [
        "en",
        "de"
      ],
      "available_languages": [
        "en",
        "de"
      ],
      "zipcode": "string",
      "birthdate": "string",
      "gender": "MALE"
    },
    "standard_profile": {},
    "network_data": {},
    "extended_data": {},
    "created_at": "string",
    "updated_at": "string"
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Get user data (as page)

GET /client/user/data/web

Returns the requesting user's data as HTML to be displayed in the browser.

Responses
GET /client/user/data/web
curl \
 -X GET https://api.bitlabs.ai/v1/client/user/data/web?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Get user

GET /client/user

Returns information and identifier of the requesting user

Responses
GET /client/user
curl \
 -X GET https://api.bitlabs.ai/v1/client/user?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "app_id": 42,
    "uid": "string",
    "user_id": 42
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Delete user

DELETE /client/user

Deletes the requesting user's data. This operation cannot be un-done!

Responses
DELETE /client/user
curl \
 -X DELETE https://api.bitlabs.ai/v1/client/user?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {},
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}
Responses
GET /client/settings
curl \
 -X GET https://api.bitlabs.ai/v1/client/settings?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "visual": {
      "color_dark": "string",
      "color_light": "string",
      "color_accent": "string"
    }
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}
Query parameters
  • color_scheme string

    optional paremeter for setting color scheme of application (if appropriate visual object available)

    Values are LIGHT or DARK.

Responses
GET /client/settings/v2
curl \
 -X GET https://api.bitlabs.ai/v1/client/settings/v2?token=api_token_value \
 -H "X-Api-Token: $API_KEY"
Response example (200)
{
  "data": {
    "currency": {
      "floor_decimal": true,
      "factor": "string",
      "symbol": {
        "content": "string",
        "is_image": true
      },
      "currency_promotion": 40,
      "bonus_percentage": 20
    },
    "logic": {
      "mode": "API",
      "privacy_enabled": true,
      "skip_question_enabled": true,
      "header_navigation_visible": true,
      "watermark_visible": true,
      "survey_bonus_enabled": true,
      "demo_mode_enabled": true,
      "survey_opening_target": "OPENING_TARGET_NONE",
      "survey_complete_target": "COMPLETE_TARGET_CLOSE_TAB",
      "first_qualification": {
        "start_bonus": "string",
        "show": true
      },
      "survey_complete_target_url": "string",
      "survey_bonus_percentage": 50
    },
    "visual": {
      "element_border_radius": "BORDER_RADIUS_NONE",
      "custom_logo_url": "string",
      "screenout_reward": "string",
      "navigation_color": "string",
      "background_color": "string",
      "interaction_color": "string",
      "survey_icon_color": "string",
      "color_rating_threshold": 42,
      "offerwall_width": "string",
      "hide_reward_value": true
    },
    "promotion": {
      "start_date": "2022-01-01T12:00:00Z",
      "end_date": "2022-01-15T12:00:00Z",
      "bonus_percentage": 20
    },
    "offers": {
      "enabled": true
    },
    "publisher": {
      "is_key_partner": true
    }
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}
Response example (406)
{
  "error": {
    "details": {
      "http": "406 Not Acceptable",
      "msg": "vpn detected"
    }
  }
}

Import Users

POST /publishers/users

Bulk imports given user accounts. This feature must be enabled by your account manager!

Body Required
Responses
  • 200 object

    OK

    • data object
      • success_count Required / integer

        Number of successfully imported users from the request

      • errors Required / array[object]

        Contains all users that could not be imported due to an error

        • uid Required / string
        • If this field is not null, the birthdate cannot be validated

        • If this field is not null, the gender cannot be validated

        • If this field is not null, the zipcode cannot be validated

        • If this field is not null, the question was not found or there is no mapping for the given answer values

        • If this field is true, the user was ignored because it did not have any supported languages.

    • error object
    • status Required / string

      Values are success or error.

    • trace_id Required / string
POST /publishers/users
curl \
 -X POST https://api.bitlabs.ai/v1/publishers/users?token=api_token_value \
 -H "X-Api-Token: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"users":[{"uid":"your_unique_id","country":"DE","languages":["de,en"],"zipcode":"00000","birthdate":"1999-01-01","gender":"MALE","questions":[{"id":"string","direct_values":["string"]}]}]}'
Request example
{
  "users": [
    {
      "uid": "your_unique_id",
      "country": "DE",
      "languages": [
        "de,en"
      ],
      "zipcode": "00000",
      "birthdate": "1999-01-01",
      "gender": "MALE",
      "questions": [
        {
          "id": "string",
          "direct_values": [
            "string"
          ]
        }
      ]
    }
  ]
}
Response example (200)
{
  "data": {
    "success_count": 42,
    "errors": [
      {
        "uid": "string",
        "invalid_birthdate": "string",
        "invalid_gender": "string",
        "invalid_zipcode": "string",
        "invalid_question": "string",
        "unsupported_languages": true
      }
    ]
  },
  "error": {
    "details": {
      "http": "string",
      "msg": "string"
    }
  },
  "status": "success",
  "trace_id": "1dc6786b10a62ec6"
}