PUT
/api/v1/app-data/{key}حفظ قيمة في بيانات التطبيق الخاصة
Values are private to this installation, at most 16,384 bytes each and 10,000 keys per installation. They are deleted when the merchant uninstalls the app.
النطاق:
app_data:manageBearer tokenالبيئات
- SANDBOX
- بيئة اختبار محلية أو مصرح بها؛ لا يوجد حاليًا Sandbox عام مستضاف.
- PRODUCTION
https://getsas.xyz/api/v1/app-data/{key}
الطلب
Headers
| Header | Value | مطلوب |
|---|---|---|
| Authorization | Bearer <ACCESS_TOKEN> | نعم |
| Content-Type | application/json | نعم |
المعاملات
| الاسم | المكان | النوع | الوصف |
|---|---|---|---|
| key | path | string | — |
| Idempotency-Key | header | string | Unique per logical write for 24 hours. Retrying the same key with the same route, target and body returns the stored result without writing again; a different request with the same key returns 409 idempotency_conflict. |
أمثلة الكود
curl --request PUT 'https://getsas.xyz/api/v1/app-data/{key}' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'
--header 'Idempotency-Key: <UNIQUE_KEY>'
--header 'Content-Type: application/json'
--data '{"resource_type":"product","resource_id":"11111111-1111-4111-8111-111111111111","value":{"synced":true}}'الاستجابة
200 Stored entry; created is true for a new key
{
"description": "Stored entry; created is true for a new key",
"headers": {
"RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitReset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AppDataWriteResponse"
}
}
}
}الأخطاء
| 400 | Invalid request |
| 401 | Missing or invalid access token |
| 403 | The route, scope and reviewed contract do not match an operation this token can use (unsupported_capability) |
| 404 | The record does not exist in the installation store (records of other stores are indistinguishable), or the Marketplace API is unavailable |
| 409 | idempotency_conflict (the key was used for a different request), invalid_transition (for example the order is not confirmed or preparing) or conflict (duplicate code, SKU or slug) |
| 413 | The streamed write body exceeds 32,768 encoded bytes; it is rejected before JSON parsing |
| 415 | Write bodies must be sent as application/json (unsupported_media_type) |
| 422 | validation_failed or quota_exceeded; error.field names the rejected input when available |
| 429 | Fixed-window request limit exceeded for this installation and route key |
| 500 | Internal API failure |
| 503 | Rate-limit service unavailable; request is rejected closed |