fetch_codes
One page of a sweepstakes codes, with the participant each code is assigned to. Filtering, search and sorting all happen server-side — use filter and search rather than pulling every page and filtering yourself. Defaults to 25 per page, maximum 500. available means not redeemed AND not assigned. For a plain count use fetch_code_stats instead, it is far cheaper. Read-only and NOT gated by the Codes & Coupons module: only the writes of this category document a module-not-enabled 403. If this call returns 403, look for another cause before telling the user the module is off.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number, starting at 1. Defaults to 1 | |
| filter | No | Which codes to return. Defaults to all. available = not redeemed and not assigned | |
| search | No | Part of a code, or of the email / phone of the assigned participant (case-insensitive, max 100 characters) | |
| sort_by | No | Sort field. Defaults to CreationDate, newest first | |
| sort_desc | No | true for descending order (applies with sort_by) | |
| items_per_page | No | Results per page, 1 to 500. Defaults to 25 | |
| sweepstakes_token | Yes | The sweepstakes token (UUID v4) of a sweepstakes of your account |