POST
v1.0.0stableCreate source
Create source. Manage only sources owned by this token on the current tenant.
POST
/api/appstore/manage/sourcesauth:Bearer Token
制限:30/分
リクエストパラメータ
すべてのパラメータは、クエリまたは本文を介して渡すことができます
| パラメーター | タイプ | 必須 | 内容 |
|---|---|---|---|
name | string | 必須 | Source name, up to 100 characters 例: 我的软件源 |
message | string | オプション | Source announcement 例: 欢迎使用 |
identifier | string | オプション | Source identifier, up to 100 characters |
source_icon | string | オプション | HTTP(S) URL of the source icon |
pay_url | string | オプション | HTTP(S) URL of the payment page |
encrypt_enabled | integer | オプション | Response encryption: 0=off, 1=on (default on when created) 例: 1 |
open_black | integer | オプション | Auto-block devices used to add apps: 0/1 例: 0 |
open_black2 | integer | オプション | Auto-block cracking attempts: 0/1 例: 0 |
health_alert | object | オプション | Complete link-health alert configuration as a JSON object |
回答
| パラメーター | タイプ | 必須 | 内容 |
|---|---|---|---|
code | integer | 必須 | 1 indicates success; otherwise a token, validation or source error code 例: 1 |
msg | string | 必須 | Localized result message 例: 获取成功 |
time | integer | 必須 | Unix timestamp in seconds |
data | object | 必須 | Allowlisted fields visible to the source owner |
応答例
{}
"code":1,
"msg":"Operation successful",
"time":1780000000,
"data":
{}
"source_id":"12345678",
"name":"我的软件源",
"source_url":"/api/rjy/12345678/appstore",
"message":"欢迎使用",
"encrypt_enabled":1,
"app_count":0
エラーコード
エラーコード4 defined
10無効なトークン
Token is invalid or rotated; HTTP 401
11トークンは期限切れです
Token has expired; HTTP 401
40001Source not found
Source is missing or not owned by this user/tenant; HTTP 404
応答言語
X-Lang ヘッダーで API 応答言語をカスタマイズします。以下のコード例は、現在のサイト言語を自動的に使用します。
推奨ヘッダー
X-Lang: ja対応言語
zh, en, zh-TW, vi, ar, es, ruアクセプト言語もサポートしています。X-Langは優先します。サポートされていない言語はサイトの言語のフォールバックに従ってください。
コード例
curl -X POST "https://testypro.iwai.cc,https://cer.xyul.cn,https://cer.iwai.cc/api/appstore/manage/sources" \
-H "X-Lang: ja" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "我的软件源",
"message": "欢迎使用",
"identifier": "example_identifier",
"source_icon": "example_source_icon",
"pay_url": "example_pay_url",
"encrypt_enabled": 1,
"open_black": 0,
"open_black2": 0,
"health_alert": "example_health_alert"
}'注
- Use HTTPS. Administrator-only fields such as uid, tenant_id, is_official and expiry time are rejected.
- Responses omit owner identities, draft internals and secrets; creating sources/apps is subject to subscription, trial and quota limits.
コンソールでお試しください
以下のパラメータを入力し、テストのリクエストを送信します。リクエストはこのサイトのAPIにのみ行きます。URLはロックされており、変更することはできません。現在のログインCookieが含まれています。
POST
https://testypro.iwai.cc/api/appstore/manage/sourcesこのサイトにロックされていますstring必須
Source name, up to 100 characters
string
Source announcement
string
Source identifier, up to 100 characters
string
HTTP(S) URL of the source icon
string
HTTP(S) URL of the payment page
integer
Response encryption: 0=off, 1=on (default on when created)
integer
Auto-block devices used to add apps: 0/1
integer
Auto-block cracking attempts: 0/1
object
Complete link-health alert configuration as a JSON object