API Specifications
Common Base URL (Host)
- Preview (Test):
https://app-api-reward.unifi.me - Production (Live):
https://api-reward.unifi.me
Check User Mapping Status
Checks if a specific user is currently connected to a Unifi account.
GET /v1/mission-users
| Section | Name | Type | Req | Description |
|---|---|---|---|---|
| Header | X-Partner-Id | String | Y | Issued Partner ID |
| Header | X-Api-Key | String | Y | Issued API Key |
| Query | partnerUid | String | Y | Unique user ID inside your service |
| Response | result | Boolean | Y | Mapping Status (true: connected, false: unconnected) |
Auth URL for Unifi Login (Auth)
A frontend-only API that redirects the user to the Unifi login screen and triggers the issuance of a one-time mapping token. (Since it is a direct browser navigation, it does not include header authentication keys).
GET /v1/mission-users/auth
| Section | Name | Type | Req | Description |
|---|---|---|---|---|
| Query | partnerId | String | Y | Your issued Partner ID |
| Query | redirectUrl | String | Y | Service Mini App URL to return to after login (*URL Encoding Required) |
| Query | browserType | String | N | Specify connection environment (MINI: LINE MINI, LIFF: LINE LIFF, WEB: other. Acts as WEB if empty) |
| Response | 302 Found | - | - | Immediately redirects browser to the constructed LINE LIFF login URL |
Register User Mapping (Connect)
Finalizes the connection between the Unifi account and your service account using the one-time mapping token.
POST /v1/mission-users/connect
| Section | Name | Type | Req | Description |
|---|---|---|---|---|
| Header | X-Partner-Id | String | Y | Issued Partner ID |
| Header | X-Api-Key | String | Y | Issued API Key |
| Body (JSON) | token | String | Y | One-time mapping token received via URL parameter |
| Body (JSON) | partnerUid | String | Y | Unique user ID inside your service |
| Body (JSON) | region | String | Y | User's Country Code (e.g., KR, JP, TW, etc.) |
| Response | 200 OK | - | - | Empty body, mapping success |
Achieve Mission
Upserts the user's mission progress and final completion status to the Unifi server in real-time. (Security & IP Restriction: Can only be called from your service server's Outbound IP (Whitelist) agreed upon in advance).
When this API is called, Unifi looks up the mission using the missionKey sent in the request, verifies that the completion is valid, and then pays out the reward.
POST /v1/achieve
| Section | Name | Type | Req | Description |
|---|---|---|---|---|
| Header | X-Partner-Id | String | Y | Issued Partner ID |
| Header | X-Api-Key | String | Y | Issued API Key |
| Body (JSON) | partnerUid | String | Y | Unique user ID inside your service |
| Body (JSON) | missionKey | String | Y | Mission Key delivered by Unifi |
| Body (JSON) | completed | Boolean | Y | Mission completion status (cannot be reversed once true is saved) |
| Body (JSON) | metadata.target | Int | N | Max target value of the mission (for progress gauge UI) |
| Body (JSON) | metadata.current | Int | N | Current progress value of the mission |
| Response | 200 OK | - | - | Empty body, saved successfully |
Data Transmission Example (JSON Payload)
{ "partnerUid": "user_77799", "missionKey": "SAMPLE_MISSION_KEY_001", "completed": false, "metadata": { "target": 30, "current": 5 } }
Error Codes
| Code | Name | Category |
|---|---|---|
| 901 | ADMIN_PERMISSION_DENIED | Admin |
| 1101 | NOT_FOUND_MISSION_GROUP | MissionGroup |
| 1201 | NOT_FOUND_MISSION | Mission |
| 1401 | NOT_FOUND_REWARD_ASSET | RewardAsset |
| 1402 | NOT_SET_REWARD_ASSET_DECIMALS | RewardAsset |
| 1902 | NOT_FOUND_REWARD_BUDGET | Budget |
| 2101 | NOT_FOUND_PROMOTION | Promotion |
| 2102 | IMMUTABLE_PROMOTION_FIELD | Promotion |
Enum Definitions
| Enum Name | Values | Description |
|---|---|---|
| PromotionType | COMPOSITE, DAILY_CHECK | Promotion Type |
| PromotionStatus | ACTIVE, INACTIVE | Promotion Active/Inactive Status |
| RecurrenceType | ONE_TIME, DAILY, WEEKLY, MONTHLY | Recurrence Cycle |
| RewardType | FIXED, LUCKY_DRAW | Fixed Reward / Lucky Draw |
| BudgetType | FIXED, LUCKY_DRAW | Budget Type |
| AssetType | FT | Asset Type |
| ClaimStatus | RESERVED, REQUESTED, REJECTED, SUCCEEDED, FAILED | Reward Claim Status |
| TicketFilter | NOT_RECEIVED, RECEIVED, DRAWN | Ticket Filter |