JSON şemaları
İstek göndermeden önce kendi tarafında doğrulamak, tip üretmek ya da editör tamamlaması için JSON Schema (draft 2020-12) dosyalarını indirebilirsin. Sunucu tam olarak bu şemalarla doğrular.
pythonimport json, urllib.request
from jsonschema import Draft202012Validator
sema = json.load(urllib.request.urlopen("https://inkiveta.com/gelistiriciler/semalar/notice.schema.json"))
Draft202012Validator(sema).validate({"type": "notice", "version": 1, "tone": "success", "title": "Tamam"})
Not: Bazı kurallar şemayla ifade edilemez ve yalnız sunucuda denetlenir (ör. tablo satırının sütun sayısıyla eşleşmesi,
selected'ın seçenekler arasında olması). Bu durumlarda hatacomponent schema: <yol>: <kural>biçiminde döner.
Bota gelen nesneler#
| Dosya | Ne |
|---|---|
[update.schema.json](/gelistiriciler/semalar/update.schema.json) | Update — sana gelen her olayın zarfı (inkiveta uzantıları dahil) |
[message.schema.json](/gelistiriciler/semalar/message.schema.json) | Message — mesaj nesnesi (inki_component, inki_components dahil) |
[user.schema.json](/gelistiriciler/semalar/user.schema.json) | User — kullanıcı (bota özel takma kimlik) |
[chat.schema.json](/gelistiriciler/semalar/chat.schema.json) | Chat — sohbet (hep private) |
[quick-actions.schema.json](/gelistiriciler/semalar/quick-actions.schema.json) | inkiSetQuickActions gövdesi |
Bileşen şemaları#
Her bileşen türü için bir JSON Schema (draft 2020-12). Ayrıntılı alan tabloları ve örnekler Yerel bileşenler sayfasında.
accordion.schema.jsonaudio.schema.jsoncalendar.schema.jsoncart.schema.jsonconfirm.schema.jsoncontact_card.schema.jsoncountdown.schema.jsoncoupon.schema.jsondamla_link.schema.jsondocument.schema.jsondropdown.schema.jsonform_summary.schema.jsongallery.schema.jsongiveaway.schema.jsongoal_progress.schema.jsonhome_page.schema.jsonhourly_weather.schema.jsonimage_card.schema.jsonink_pay.schema.jsoninvite.schema.jsonkey_value.schema.jsonleaderboard.schema.jsonline_chart.schema.jsonlive_courier.schema.jsonlive_poll.schema.jsonlive_score.schema.jsonlocation.schema.jsonlocation_pick.schema.jsonlong_text.schema.jsonmetric_tiles.schema.jsonmood.schema.jsonmultistep_form.schema.jsonnotice.schema.jsonnps.schema.jsonoption_picker.schema.jsonpayment_status.schema.jsonplans.schema.jsonproduct_grid.schema.jsonquick_replies.schema.jsonquiz_question.schema.jsonquiz_result.schema.jsonrange_slider.schema.jsonrich_text.schema.jsonsearch_select.schema.jsonsecurity_card.schema.jsonsingle_choice.schema.jsonstepper_toggles.schema.jsonsteps.schema.jsontabbed_menu.schema.jsontable.schema.jsonticket.schema.jsontime_strip.schema.jsontimeline.schema.jsontip.schema.jsonundo_bar.schema.jsonupload.schema.jsonvideo.schema.json