Create session token

POST /api/v1/session/

Create session token

Create session token

application/json

Body

  • app_key string Required

    The key for the app that is creating the session. Generated on the Appylar website.

  • app_id string

    The app's bundle id for the app that is creating the session.

  • density number Required

    The pixel density of the screen.

  • width integer Required

    The width of the app container where ads will be shown.

  • height integer Required

    The height of the app container where ads will be shown.

  • language string Required

    The language code for the user session. Must be a valid ISO 639-1 language tag.

    Values are aa, ab, af, ak, am, an, ar, as, av, ay, az, ba, be, bg, bh, bi, bm, bn, bo, br, bs, ca, ce, ch, co, cr, cs, cu, cv, cy, da, de, dv, dz, ee, el, en, eo, es, et, eu, fa, ff, fi, fj, fo, fr, fy, ga, gd, gl, gn, gu, gv, ha, he, hi, ho, hr, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, io, is, it, iu, ja, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ku, kv, kw, ky, la, lb, lg, li, ln, lo, lt, lu, lv, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, my, na, nb, nd, ne, ng, nl, nn, no, nr, nv, ny, oc, oj, om, or, os, pa, pi, pl, ps, pt, qu, rm, rn, ro, ru, rw, sa, sc, sd, se, sg, sh, si, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, tg, th, ti, tk, tl, tn, to, tr, ts, tt, tw, ty, ug, uk, ur, uz, ve, vi, vo, wa, wo, xh, yi, yo, za, zh, or zu.

  • country string

    The country code for the user session. Must be a valid ISO 3166-1 alpha-2 country code.

    Values are AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, or ZW.

  • test_mode boolean Required

    If test mode should be enabled or not. Test mode will only deliver test ads without side effects in the system.

Responses

  • 429 application/json

    Too many requests

    Hide response attributes Show response attributes object
    • error Required

      The error code

      Default value is err_rate_limited.

    • wait integer Required

      The minimum number of seconds to wait before trying the same request again

  • 403 application/json

    Forbidden

    Hide response attribute Show response attribute object
    • error Required

      The error code

      Default value is err_forbidden.

  • 401 application/json

    Unauthorized

    Hide response attribute Show response attribute object
    • error Required

      The error code

      Default value is err_unauthorized.

  • 400 application/json

    Invalid data

    Hide response attributes Show response attributes object
    • error string Required

      The error code

    • errors object

      The name of the field

      Hide errors attribute Show errors attribute object
      • * array[string] Additional properties

        A list of errors for the field

  • 200 application/json

    Session created

    Hide response attributes Show response attributes object
    • The session token that must be used as authorization for authorized calls.

    • Additional properties are allowed.

      Hide buffer_limits attribute Show buffer_limits attribute object
      • min integer

        The minimum limit for when new ads should be requested and added to the buffer.

    • The number of seconds to show a banner ad before switching to the next one.

POST /api/v1/session/
curl \
 --request POST 'https://www.appylar.com/api/v1/session/' \
 --header "Content-Type: application/json" \
 --data '{"app_key":"string","app_id":"string","density":2,"width":320,"height":480,"language":"aa","country":"AD","test_mode":true}'
Request examples
{
  "app_key": "string",
  "app_id": "string",
  "density": 2,
  "width": 320,
  "height": 480,
  "language": "aa",
  "country": "AD",
  "test_mode": true
}
Response examples (429)
{
  "error": "err_rate_limited",
  "wait": 60
}
Response examples (403)
{
  "error": "err_forbidden"
}
Response examples (401)
{
  "error": "err_unauthorized"
}
Response examples (400)
{
  "error": "string",
  "errors": {
    "additionalProperty1": [
      "string"
    ],
    "additionalProperty2": [
      "string"
    ]
  }
}
Response examples (200)
{
  "session_token": "string",
  "buffer_limits": {
    "min": 5
  },
  "rotation_interval": 30
}