396 lines
13 KiB
YAML
396 lines
13 KiB
YAML
openapi: 3.1.0
|
|
info:
|
|
title: Android App Manager API
|
|
version: 1.0.0
|
|
description: |
|
|
Multi-tenant API for Android app configuration and Cafe Bazaar integrations.
|
|
Every `{app}` value is the Android package name configured in Filament. All requests need
|
|
`X-App-Key`; privileged operations additionally need `X-Management-Key`.
|
|
Cafe Bazaar upstream errors retain their HTTP status and are returned in `error`.
|
|
externalDocs:
|
|
description: Cafe Bazaar Persian developer documentation
|
|
url: https://developers.cafebazaar.ir/fa
|
|
servers:
|
|
- url: /api/v1/apps/{app}
|
|
variables:
|
|
app:
|
|
default: ir.example.app
|
|
security:
|
|
- AppKey: []
|
|
tags:
|
|
- name: App
|
|
- name: Billing
|
|
- name: Subscriptions
|
|
- name: Login
|
|
- name: Reviews
|
|
- name: Publishing
|
|
paths:
|
|
/:
|
|
get:
|
|
tags: [App]
|
|
summary: Get app configuration, feature flags, update policy, and Bazaar client settings
|
|
responses:
|
|
'200':
|
|
description: App configuration
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AppConfigurationResponse'
|
|
'401': { $ref: '#/components/responses/InvalidAppKey' }
|
|
/bazaar/billing/purchases/validate:
|
|
post:
|
|
tags: [Billing]
|
|
summary: Validate a one-time in-app purchase with Bazaar
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PurchaseRequest'
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
'404': { $ref: '#/components/responses/BazaarError' }
|
|
'422': { $ref: '#/components/responses/ValidationError' }
|
|
/bazaar/billing/purchases/consume:
|
|
post:
|
|
tags: [Billing]
|
|
summary: Consume a one-time purchase
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/PurchaseToken'
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
'400': { $ref: '#/components/responses/BazaarError' }
|
|
/bazaar/billing/signatures/verify:
|
|
post:
|
|
tags: [Billing]
|
|
summary: Verify a Bazaar purchase signature on the server
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [original_json, signature]
|
|
properties:
|
|
original_json: { type: string }
|
|
signature: { type: string, description: Base64-encoded SHA1withRSA signature }
|
|
responses:
|
|
'200':
|
|
description: Signature result
|
|
/bazaar/billing/purchases/refund:
|
|
post:
|
|
tags: [Billing]
|
|
summary: Refund a purchase or subscription
|
|
security:
|
|
- AppKey: []
|
|
ManagementKey: []
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/PurchaseToken'
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
'403': { $ref: '#/components/responses/InvalidManagementKey' }
|
|
/bazaar/billing/subscriptions/validate:
|
|
post:
|
|
tags: [Subscriptions]
|
|
summary: Get a subscription purchase, including expired subscriptions
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SubscriptionRequest'
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
'404': { $ref: '#/components/responses/BazaarError' }
|
|
/bazaar/billing/subscriptions/active:
|
|
post:
|
|
tags: [Subscriptions]
|
|
summary: List active subscriptions associated with any user purchase token
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/PurchaseToken'
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
'404': { $ref: '#/components/responses/BazaarError' }
|
|
/bazaar/billing/subscriptions/cancel:
|
|
post:
|
|
tags: [Subscriptions]
|
|
summary: Cancel automatic renewal of a subscription
|
|
security:
|
|
- AppKey: []
|
|
ManagementKey: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SubscriptionRequest'
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
'403': { $ref: '#/components/responses/InvalidManagementKey' }
|
|
/bazaar/login/authorization-url:
|
|
get:
|
|
tags: [Login]
|
|
summary: Build the Bazaar OAuth authorization URL
|
|
parameters:
|
|
- name: state
|
|
in: query
|
|
required: true
|
|
schema: { type: string, maxLength: 255 }
|
|
responses:
|
|
'200': { description: Authorization URL }
|
|
/bazaar/login/exchange:
|
|
post:
|
|
tags: [Login]
|
|
summary: Exchange a Bazaar authorization code for tokens
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [code]
|
|
properties:
|
|
code: { type: string }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/login/refresh:
|
|
post:
|
|
tags: [Login]
|
|
summary: Refresh a Bazaar OAuth access token
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [refresh_token]
|
|
properties:
|
|
refresh_token: { type: string }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/login/user:
|
|
get:
|
|
tags: [Login]
|
|
summary: Get the Bazaar account ID for an access token
|
|
description: Send the Bazaar OAuth access token in the standard Authorization Bearer header.
|
|
parameters:
|
|
- name: Authorization
|
|
in: header
|
|
required: true
|
|
schema: { type: string, example: 'Bearer bazaar-access-token' }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/reviews:
|
|
get:
|
|
tags: [Reviews]
|
|
summary: List and synchronize Bazaar reviews
|
|
parameters:
|
|
- { name: publish_date_after, in: query, schema: { type: string, format: date-time } }
|
|
- { name: publish_date_before, in: query, schema: { type: string, format: date-time } }
|
|
- { name: rate_min, in: query, schema: { type: integer, minimum: 1, maximum: 5 } }
|
|
- { name: rate_max, in: query, schema: { type: integer, minimum: 1, maximum: 5 } }
|
|
- { name: app_version_code, in: query, schema: { type: integer } }
|
|
- { name: sdk_version, in: query, schema: { type: integer } }
|
|
- { name: is_replied, in: query, schema: { type: boolean } }
|
|
- { name: cursor, in: query, schema: { type: string } }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/reviews/{reviewId}/reply:
|
|
post:
|
|
tags: [Reviews]
|
|
summary: Reply to a Bazaar review (publication is subject to Bazaar approval)
|
|
security:
|
|
- AppKey: []
|
|
ManagementKey: []
|
|
parameters:
|
|
- name: reviewId
|
|
in: path
|
|
required: true
|
|
schema: { type: integer }
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [text]
|
|
properties:
|
|
text: { type: string, maxLength: 1000 }
|
|
email: { type: string, format: email }
|
|
responses:
|
|
'201': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases:
|
|
post:
|
|
tags: [Publishing]
|
|
summary: Create a draft release
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
responses:
|
|
'201': { $ref: '#/components/responses/BazaarSuccess' }
|
|
delete:
|
|
tags: [Publishing]
|
|
summary: Delete the current uncommitted release
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases/apk:
|
|
post:
|
|
tags: [Publishing]
|
|
summary: Upload an APK to the current draft release
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
required: [architecture, apk]
|
|
properties:
|
|
architecture: { type: string, enum: [all, armeabi-v7a, arm64-v8a] }
|
|
apk: { type: string, format: binary }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases/aab:
|
|
post:
|
|
tags: [Publishing]
|
|
summary: Upload an Android App Bundle
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
required: [aab]
|
|
properties:
|
|
aab: { type: string, format: binary }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases/bin:
|
|
post:
|
|
tags: [Publishing]
|
|
summary: Upload the Bundle Signer BIN file after AAB upload
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
required: [bin]
|
|
properties:
|
|
bin: { type: string, format: binary }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases/bundle-status:
|
|
get:
|
|
tags: [Publishing]
|
|
summary: Get AAB processing status (U, S, P, D, or E)
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases/commit:
|
|
post:
|
|
tags: [Publishing]
|
|
summary: Submit a release for review with staged rollout and auto-publish options
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [staged_rollout_percentage, auto_publish]
|
|
properties:
|
|
changelog_fa: { type: string, maxLength: 5000 }
|
|
changelog_en: { type: string, maxLength: 5000 }
|
|
developer_note: { type: string, maxLength: 5000 }
|
|
staged_rollout_percentage: { type: integer, minimum: 1, maximum: 100 }
|
|
auto_publish: { type: boolean }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
/bazaar/releases/last/{state}:
|
|
get:
|
|
tags: [Publishing]
|
|
summary: Get the last committed, uncommitted, or published release
|
|
security: [{ AppKey: [], ManagementKey: [] }]
|
|
parameters:
|
|
- name: state
|
|
in: path
|
|
required: true
|
|
schema: { type: string, enum: [committed, uncommitted, published] }
|
|
responses:
|
|
'200': { $ref: '#/components/responses/BazaarSuccess' }
|
|
components:
|
|
securitySchemes:
|
|
AppKey:
|
|
type: apiKey
|
|
in: header
|
|
name: X-App-Key
|
|
ManagementKey:
|
|
type: apiKey
|
|
in: header
|
|
name: X-Management-Key
|
|
requestBodies:
|
|
PurchaseToken:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required: [purchase_token]
|
|
properties:
|
|
purchase_token: { type: string, maxLength: 2048 }
|
|
schemas:
|
|
PurchaseRequest:
|
|
type: object
|
|
required: [product_id, purchase_token]
|
|
properties:
|
|
product_id: { type: string, maxLength: 255 }
|
|
purchase_token: { type: string, maxLength: 2048 }
|
|
SubscriptionRequest:
|
|
type: object
|
|
required: [subscription_id, purchase_token]
|
|
properties:
|
|
subscription_id: { type: string, maxLength: 255 }
|
|
purchase_token: { type: string, maxLength: 2048 }
|
|
AppConfigurationResponse:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: object
|
|
properties:
|
|
name: { type: string }
|
|
package_name: { type: string }
|
|
maintenance_mode: { type: boolean }
|
|
version: { type: object, additionalProperties: true }
|
|
support: { type: object, additionalProperties: true }
|
|
configuration: { type: object, additionalProperties: true }
|
|
feature_flags: { type: object, additionalProperties: true }
|
|
bazaar: { type: object, additionalProperties: true }
|
|
BazaarEnvelope:
|
|
type: object
|
|
properties:
|
|
data: { type: [object, 'null'], additionalProperties: true }
|
|
error: { type: [object, 'null'], additionalProperties: true }
|
|
meta:
|
|
type: object
|
|
properties:
|
|
bazaar_status: { type: integer }
|
|
responses:
|
|
BazaarSuccess:
|
|
description: Cafe Bazaar accepted the request
|
|
content:
|
|
application/json:
|
|
schema: { $ref: '#/components/schemas/BazaarEnvelope' }
|
|
BazaarError:
|
|
description: Cafe Bazaar rejected the request
|
|
content:
|
|
application/json:
|
|
schema: { $ref: '#/components/schemas/BazaarEnvelope' }
|
|
InvalidAppKey:
|
|
description: Missing or invalid X-App-Key
|
|
InvalidManagementKey:
|
|
description: Missing or invalid X-Management-Key
|
|
ValidationError:
|
|
description: Request validation failed
|