Import Users

POST /v1/publishers/users

Bulk imports given user accounts. This feature must be enabled by your account manager! If more than one user is sent in a request, that request is treated as a bulk import. Only one bulk import can be issued at a time. If only one user is set, you can call the endpoint in parallel.

application/json

Body Required

  • users array[object] Required
    Hide users attributes Show users attributes object
    • uid string Required
    • country string Required
    • languages array[string] Required
    • zipcode string
    • birthdate string Required
    • gender string Required

      Values are MALE, FEMALE, or OTHER.

    • questions array[object] Required
      Hide questions attributes Show questions attributes object
    • username string

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

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes
      • success_count integer Required

        Number of successfully imported users from the request

      • errors array[object] Required

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

        Hide errors attributes Show errors attributes object
        • uid string Required
        • 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.

        • If this field is not null, the supplied answer for the given question is invalid.

          Hide invalid_answer_format attributes Show invalid_answer_format attributes
POST /v1/publishers/users
curl \
 -X POST https://api.bitlabs.ai/v1/publishers/users \
 -H "X-S2S-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","network_id":42,"direct_values":["string"]}],"username":"string"}]}'
Request example
{
  "users": [
    {
      "uid": "your_unique_id",
      "country": "DE",
      "languages": [
        "de",
        "en"
      ],
      "zipcode": "00000",
      "birthdate": "1999-01-01",
      "gender": "MALE",
      "questions": [
        {
          "id": "string",
          "network_id": 42,
          "direct_values": [
            "string"
          ]
        }
      ],
      "username": "string"
    }
  ]
}
Response examples (200)
{
  "data": {
    "success_count": 42,
    "errors": [
      {
        "uid": "string",
        "invalid_birthdate": "string",
        "invalid_gender": "string",
        "invalid_zipcode": "string",
        "invalid_question": "string",
        "unsupported_languages": true,
        "invalid_answer_format": {
          "question": "string",
          "reason": "string"
        }
      }
    ]
  }
}