palbaseDocs

Palbase IAP · API

PUT/iap/placements/{placement}

Give a placement a paywall

Gives a placement its default paywall, making the placement when it is new: what it shows whoever none of its rules holds for. The apps that ask for it get the paywall's newest version they can draw; a paywall never published is nothing yet (they get 204 and draw their own). While an experiment runs for everyone at the placement, the experiment decides, and its end the default (409 experiment_running). A project has at most 200 placements (409 too_many_placements).

Called by your server, with the project's secret key.

Path

placementstring · requiredThe placement's key: the place in the app a paywall is shown, as the app names it.

Headers

Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.

Request body

paywall_idstring (uuid) · requiredThe paywall.
curl
curl -X PUT "https://<your-ref>.palbase.studio/iap/placements/<placement>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"paywall_id":"00000000-0000-0000-0000-000000000000"}'

Responses

200The placement

400The key is not a placement's: lowercase letters, digits, _ and -, at most 64 (`invalid_placement`); or the body is malformed

401No key, not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key (`secret_key_required`)

404No such paywall (`paywall_not_found`)

409An experiment runs on the placement (`experiment_running`); or the project has 200 placements (`too_many_placements`); or a request with this Idempotency-Key is still running (`idempotency_key_in_use`, Retry-After)

413The request body is too large (`request_too_large`)

422The Idempotency-Key was sent with a different request (`idempotency_key_reused`)

429Over the project's request limit; Retry-After says when to try again

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation SetPlacement of iap's contract.