कॉन्सेप्ट्स
Scopes
Scopes तय करते हैं कि एक key क्या कर सकती है। इन्हें key बनाते समय चुनें; हर key को सिर्फ़ उतना ही दें जितना उसे चाहिए।
किसी ऐसे endpoint पर request, जिसका scope key में नहीं है, 403 INSUFFICIENT_SCOPE के साथ fail होती है। किसी मौजूदा key में scopes नहीं जोड़े जा सकते: एक नई key बनाएँ और पुरानी को revoke करें।
उपलब्ध नहीं: payments, wallet, tokens, transfers और अकाउंट सेटिंग्स। कोई भी scope इन तक एक्सेस नहीं देता।
सभी scopes#
| Scope | अनुमति |
|---|---|
profile:read | अपनी प्रोफ़ाइल और दूसरे यूज़र्स की पब्लिक प्रोफ़ाइल पढ़ना। |
posts:read | पोस्ट पढ़ना (आपकी और वे जो आप ऐप में देख सकते हैं) और उनके कमेंट्स। |
posts:write | मीडिया अपलोड करना, अपनी पोस्ट पब्लिश, एडिट और डिलीट करना। |
comments:write | कमेंट्स लिखना और अपने कमेंट्स (या अपनी पोस्ट पर आए कमेंट्स) डिलीट करना। |
likes:write | पोस्ट को लाइक और अनलाइक करना। |
follows:write | यूज़र्स को फ़ॉलो और अनफ़ॉलो करना। |
stories:write | स्टोरीज़ पब्लिश करना। |
store:read | अपना Bloop स्टोर और उसके प्रोडक्ट्स पढ़ना। |
store:write | अपना स्टोर एडिट करना, प्रोडक्ट्स बनाना, अपडेट और डिलीट करना, स्टॉक अपडेट करना। |
orders:read | आपके स्टोर को मिले ऑर्डर पढ़ना। |
orders:write | ऑर्डर को शिप्ड मार्क करना। |
chat:read | अपनी बातचीत और उनके मैसेज पढ़ना। |
chat:write | मैसेज भेजना (anti-spam नियम के साथ)। |
Scope के अनुसार endpoints#
सभी paths https://api.linework.app/open/v1 के सापेक्ष हैं।
| Endpoint | Scope |
|---|---|
GET /me | profile:read |
GET /users/{id} | profile:read |
GET /users/by-username/{username} | profile:read |
GET /me/posts | posts:read |
GET /users/{id}/posts | posts:read |
GET /posts/{id} | posts:read |
GET /posts/{id}/comments | posts:read |
POST /media | posts:write, stories:write या store:write |
POST /posts | posts:write |
PATCH /posts/{id} | posts:write |
DELETE /posts/{id} | posts:write |
POST /posts/{id}/comments | comments:write |
DELETE /comments/{id} | comments:write |
POST DELETE /posts/{id}/like | likes:write |
POST DELETE /users/{id}/follow | follows:write |
POST /stories | stories:write |
GET /store | store:read |
POST PATCH /store | store:write |
GET /store/products | store:read |
POST /store/products | store:write |
PATCH DELETE /store/products/{id} | store:write |
PATCH /store/products/{id}/stock | store:write |
GET /store/orders | orders:read |
GET /store/orders/{id} | orders:read |
POST /store/orders/{id}/ship | orders:write |
GET /conversations | chat:read |
GET /conversations/{id}/messages | chat:read |
POST /conversations/{id}/messages | chat:write |
POST /messages | chat:write |
API Reference ही अंतिम स्रोत है: हर operation में उसका ज़रूरी scope दिया गया है।
सुझाए गए सेट#
| Integration | Scopes |
|---|---|
| पब्लिशिंग bot | profile:read posts:read posts:write stories:write |
| कम्युनिटी मैनेजर | posts:read comments:write likes:write |
| स्टोर सिंक | store:read store:write orders:read orders:write |
| सपोर्ट चैट bot | chat:read chat:write (+ ऑर्डर देखने के लिए orders:read) |