Skip to main content

Documentation Index

Fetch the complete documentation index at: https://playcamp.io/docs/llms.txt

Use this file to discover all available pages before exploring further.

Before a campaign goes live, you can verify that WebView integration works correctly in the live environment. In test mode, no data is written to the database, but webhooks are sent in real time — so you can verify your game server’s webhook handling end-to-end.
Test mode does not apply to coupons. Redeeming a coupon in test mode will consume the actual coupon.

How It Works

FeatureTest Mode Behavior
CreatorsReturns mock data (TEST1, TEST2, TEST3)
Boost register/change/removeMock response + real webhook sent (no DB write)
Boost status queryStored in session — persists after registration
Campaign listReal DB query — all statuses except COMPLETED, CANCELLED
Campaign detailReal DB query
CouponsNot applied — real coupons are consumed
WebView UIPurple “TEST MODE” banner at the top

Flow

Step 1: Add isTest: true to OTT Issuance

When issuing an OTT from the game server, add isTest: true to put the entire session into test mode.
curl -X POST "https://sdk-api.playcamp.io/v1/server/webview/ott" \
  -H "Authorization: Bearer {SERVER_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user-123",
    "campaignId": "camp-abc",
    "isTest": true
  }'
isTest propagates from OTT to the session and persists for the session’s lifetime. It cannot be set from the WebView URL or client-side — it must be set at OTT issuance using the Server API Key.

Step 2: Test in the WebView

When entering the test mode WebView, a purple TEST MODE banner is displayed at the top.

Campaign List

In normal mode, only IN_PROGRESS and COMPLETED campaigns are shown. In test mode, campaigns from draft/review stages are also visible:
ModeAllowedBlocked
NormalIN_PROGRESS, COMPLETEDAll others
TestDRAFT, PENDING_REVIEW, REJECTED, PENDING_EXPOSURE, EXPOSED, IN_PROGRESSCOMPLETED, CANCELLED
This allows WebView QA from the draft stage (DRAFT) through pre-launch (EXPOSED, PENDING_EXPOSURE).

Creators

In test mode, fixed mock creators are returned:
creatorKeycreatorNamestatus
TEST1[Mock] AlphaTEST
TEST2[Mock] BravoTEST
TEST3[Mock] CharlieTEST

Boost

When registering/changing/removing a boost:
  • DB write: None
  • Response: Mock data
  • Webhook: Actually sent (includes _isTestData: true)
  • Session state: Stored in Redis session, persists across page refreshes

Step 3: Handle _isTestData in Webhooks

Webhooks from test mode include an _isTestData: true field:
{
  "events": [
    {
      "event": "sponsor.created",
      "data": {
        "userId": "user-123",
        "campaignId": "camp-abc",
        "creatorKey": "TEST1",
        "_isTestData": true
      },
      "timestamp": "2026-04-16T05:00:00.000Z",
      "callbackId": "..."
    }
  ]
}
Check _isTestData in your webhook handler to distinguish test webhooks from real ones:
app.post('/webhooks/playcamp', (req, res) => {
  for (const { event, data } of req.body.events) {
    if (data._isTestData) {
      console.log(`[TEST] ${event}`, data);
      continue;
    }

    // Production handling logic
  }

  res.json({ received: true });
});
Applies to events: sponsor.created, sponsor.changed, sponsor.ended
If campaignId is not specified when issuing the OTT, the webhook payload’s campaignId will be set to the literal string 'TEST_CAMPAIGN'. If your game server tries to look up a campaign with this value, it will get a 404. Skip campaignId lookups for webhooks where _isTestData: true.

Important Notes

  • Coupons are not affected by test mode: Redeeming a coupon in test mode consumes the actual coupon
  • Sandbox vs Live: Test mode is safe to use in the live environment. It can be used alongside the sandbox environment
  • Integration verification: Calls with isTest: true count toward integration completion requirements