Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
速習XRPC / Learning XRPC
Search
鎌倉
April 28, 2023
Technology
0
480
速習XRPC / Learning XRPC
Bluesky/ATProtocol勉強会 #1の発表資料です。
Bluesky (ATP) のAPIを叩いてみたい人向けに、基本的な概念や触り方を解説しています。
鎌倉
April 28, 2023
Tweet
Share
More Decks by 鎌倉
See All by 鎌倉
Svelte & Nostr
akiomik
0
330
Nostrのカスタムフィードの現状 / About Nostr custom feed
akiomik
0
310
日本人が開発した アプリ紹介 / Introduction of apps developed by Japanese
akiomik
0
620
Bluesky と Android / Bluesky and Android
akiomik
0
920
Nostr版togetterのNosliとNIP-33 / About Nosli and NIP-33
akiomik
0
480
話題の投稿がみれるサービス Nostrendsをつくったよ🤙 / About Nostrends
akiomik
0
660
Other Decks in Technology
See All in Technology
ミスが許されない領域にAIを溶け込ませる プロダクトマネジメントの裏側
t01062sy
8
8.4k
検証と資産化を形にするプロダクト組織へ/tapple_pmconf2024
corin8823
1
9.5k
PostgreSQL Conference Japan 2024 A4 Comparison of column-oriented access methods
nori_shinoda
0
150
品質管理チームのEMとして大事にしていること / QA EM
nihonbuson
0
840
セキュリティ系アップデート全体像と AWS Organizations 新ポリシー「宣言型ポリシー」を紹介 / reGrowth 2024 Security
masahirokawahara
0
140
イベントをどう管理するか
mikanichinose
1
120
TimeTreeが経た3つの転換点 ー プロダクト成長過程でその時、その瞬間、何を考えてたか
ysmtysts
1
3.7k
Amazon Bedrock Multi-Agent Collaboration Workshop の紹介 - ワークショップでAIエージェントを学ぼう
nasuvitz
3
300
知らない景色を見に行こう チャンスを掴んだら道が開けたマネジメントの旅 / Into the unknown~My management journey~
kakehashi
10
1.2k
総会員数1,500万人のレストランWeb予約サービスにおけるRustの活用
kymmt90
3
2.9k
開発者向けツールを魔改造してセキュリティ診断ツールを作っている話 - 第1回 セキュリティ若手の会 LT
pizzacat83
0
400
PR TIMESにおけるNext.jsとcacheの付き合い方
apple_yagi
2
250
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
780
Designing for Performance
lara
604
68k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Into the Great Unknown - MozCon
thekraken
33
1.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Building Adaptive Systems
keathley
38
2.3k
Practical Orchestrator
shlominoach
186
10k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
A Philosophy of Restraint
colly
203
16k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Transcript
श931$ #MVFTLZ"51SPUPDPMษڧձ ח !PNJCTLZTPDJBM
ࣗݾհ w 8FCΤϯδχΞ w ੨Ӣͱ͍͏#MVFTLZ༻"OESPJEΫϥΠΞϯτΛ࡞ͬͯ·͢ w IUUQTHJUIVCDPNBLJPNJLTFJVO
લఏࣝͱΰʔϧ w લఏࣝ w Ұൠతͳ8FC"1*͕৮ΕΔ w ˞࣮ऀࢹͷ͕த৺Ͱ͢ w ΰʔϧ w
-FYJDPOͷجຊతͳา͖ํ͕Θ͔Δ w ཁΛ͔͍ͭ·ΜͰۦ͚ؾຯʹਐΈ·͢
ΞδΣϯμ w ओཁͳͭͷ༻ޠ 931$ɺ-FYJDPOɺ/4*% w -FYJDPOೖ ୳͠ํͱओཁͳܕ w
ϦΫΤετͱೝূ w SFDPSEͱϦϙδτϦͷૢ࡞ w ͦͷଞ
ओཁͳͭͷ༻ޠ
931$ w $SPTTTZTUFN3FNPUF1SPDFEVSF$BMMT w 31$ ԕִखଓ͖ݺͼग़͠ ͷن֨ͷҰछ w H31$ 40"1
w "51SPUPDPMͷಠ༷ࣗ w )551 4 ͷ্Ͱಈ࡞ w 1%4ͱͷσʔλͷΓऔΓʹར༻
-FYJDPO w ϨΩγίϯ w ӳ<໊>༻ޠूɺޠኮɺࣙॻ w 931$ͷϝιουσʔλܕͷఆ ٛ w ·ͨͦΕΒͷϑΥʔϚοτ
+40/4DIFNB෩
/4*% w /BNF4QBDFE*% w -FYJDPOͷϦιʔεΛҰҙʹࣝผ͢ ΔͨΊͷ*% w 3FWFSTF%/4ܗࣜͰදه w +BWBͰΑ͘ݟΔΞϨ
w ΤϯυϙΠϯτ·ͨܕͱͯ͠༻
"51SPUPDPM 931$ Ͱͷ"1*ݺͼग़͠ -FYJDPOʹΑͬͯݺͼग़͕͠ఆΊΒΕͨ /4*%ܗࣜͷΤϯυϙΠϯτΛίʔϧ
-FYJDPOࣄ࢝Ί
-FYJDPOͷ୳͠ํ w ެࣜυΩϡϝϯτʹҰཡ͋Γ·͢ w IUUQTBUQSPUPDPNEPDT w ͨͩ͠ใ͕ݹ͔ͬͨΓෆ͍ͯ͠ Δ߹ w ࠷৽ͷ༷ʹ͍ͭͯHJUIVCͷϦϙδτ
ϦͷMFYJDPOTΛࢀর͢Δͷ͕࣮֬ w IUUQTHJUIVCDPNCMVFTLZTPDJBM BUQSPUPUSFFNBJOMFYJDPOT
-FYJDPOͷܕ w PCKFDU w QSPDFEVSF w RVFSZ w ϓϦϛςΟϒܕ JOUFHFSTUSJOHͳͲ
w ಛघͳܕ SFDPSE SFG VOJPO CMPC UPLFO TVCTDSJQUJPOͳͲ w ࠓճSFDPSEͷΈѻ͍·͢
PCKFDU { "id": "app.bsky.actor.defs", "defs": { "profileViewBasic": { "type": "object",
"required": ["did", "handle"], "properties": { "did": { "type": "string" }, "handle": { "type": "string" }, "avatar": { "type": "string" }, "viewer": { "type": "ref" }, "labels": { "type": "array" } } } } } w Ұൠతͳσʔλܕ w SFRVJSFEOPUOVMM w ˠͷ/4*% BQQCTLZBDUPSEFGTQSP fi MF7JFX#BTJD ˞ൈਮ
QSPDFEVSF { "id": "com.atproto.server.createSession", "defs": { "main": { "type": "procedure",
"input": { "schema": { "properties": { "identifier": { "type": "string" }, "password": { "type": "string" } } } }, "output": { "schema": { "properties": { "accessJwt": { "type": "string" }, "did": { "type": "string" }, } } } } } } w ߋ৽ܥϝιου w JOQVUPVUQVUΛ࣋ͭ w ӈͷ/4*% DPNBUQSPUPTFSWFSDSFB UF4FTTJPO NBJOলུ ˞ൈਮ
RVFSZ { "id": "app.bsky.feed.getTimeline", "defs": { "main": { "type": "query",
"parameters": { "type": "params", "properties": { "cursor": { "type": "string" } } }, "output": { "schema": { "properties": { "cursor": { "type": "string" }, "feed": { "type": "array" } } } } } } } w ࢀরܥϝιου w QBSBNFUFSTPVUQVUΛ࣋ͭ w ˠͷ/4*% BQQCTLZGFFEHFU5JNFMJO F ˞ൈਮ
ϦΫΤετͱೝূ
ϦΫΤετ w #MVFTLZͷ߹IUUQTCTLZTPDJBMYSQDOJTEʹରͯ͠ߦ͏ w αʔυύʔςΟ1%4ͷ߹ACTLZTPDJBMAͷ෦͕มΘΔ w ྫ w QSPDFEVSF1045IUUQTCTLZTPDJBMYSQD DPNBUQSPUPTFSWFSDSFBUF4FTTJPO
w RVFSZ(&5IUUQTCTLZTPDJBMYSQDBQQCTLZGFFEHFU5JNFMJOF
ϩάΠϯͷ-FYJDPO { "id": "com.atproto.server.createSession", "defs": { "main": { "type": "procedure",
"input": { "encoding": "application/json", "schema": { "required": [ "identifier", "password" ], "properties": { "identifier": { "type": "string" }, "password": { "type": "string" } } } } } } } ˞ൈਮ ϦΫΤετ1045 ϦΫΤετ#PEZ+40/ JEFOUJ fi FSͱQBTTXPSEඞਢ IBOEMFPSFNBJM ΤϯυϙΠϯτ YSQDDPNBUQSPUPTFSWFSDSFBUF4FTTJPO
ϩάΠϯͷϦΫΤετ curl -X POST \ -H 'Content-Type: application/json' \ -d
'{"identifier": "tester.bsky.social", "password": "foo"}' \ 'https://bsky.social/xrpc/com.atproto.server.createSession' # response { "did":"did:plc:ji4f2ypncqko5cm62pmyxh67", ... "accessJwt":"...", "refreshJwt":"..." } ೝূ͕ඞཁͳΤϯυϙΠϯτ ฦ͖ͬͯͨ+85ΛϦΫΤετʹؚΊΔ
RVFSZͷ-FYJDPO ϢʔβϑΟʔυͷऔಘ { "id": "app.bsky.feed.getAuthorFeed", "defs": { "main": { "type":
"query", "parameters": { "type": "params", "required": ["actor"], "properties": { "cursor": { "type": "string" } } } } } } ˞ൈਮ ϦΫΤετ(&5 ΫΤϦύϥϝʔλ ΤϯυϙΠϯτ YSQDBQQCTLZGFFEHFU"VUIPS'FFE BDUPS ͲͷϢʔβ͔ ඞਢ
RVFSZͷϦΫΤετ ϢʔβϑΟʔυͷऔಘ curl -X GET -H 'Authorization: Bearer ${createSessionで取得したaccessJwt}' 'https://bsky.social/xrpc/app.bsky.feed.getAuthorFeed?actor=foo'
ϦϙδτϦͱSFDPSE
ϦϙδτϦ %BUB3FQPTJUPSZ w 5-%3 w ϦϙδτϦॺ໊σʔλͷίϨΫγϣϯ w HJUͷϦϙδτϦΈ͍ͨͳͷ ͨͩ͠%#ͷϨίʔυ༻
w Ϣʔβ֤ʑͷެ։ΞΫςΟϏςΟΛࣗͷϦϙδτϦʹه w #MVFTLZ BQQCTLZ ͷ߹ɺߘɾϑΥϩʔɾ͍͍ͶͳͲ͕֨ೲ͞ ΕΔ
SFDPSE { "id": "app.bsky.feed.post", "defs": { "main": { "type": "record",
"key": "tid", "record": { "type": "object", "required": ["text", "createdAt"], "properties": { "text": { "type": "string" }, "createdAt": { "type": "string", "format": "datetime" } } } } } } w ϦϙδτϦ༻ͷσʔλܕ w ˠ#MVFTLZͷߘ QPTU ͷܕ ˞ൈਮ
ϦϙδτϦૢ࡞ { "id": "com.atproto.repo.createRecord", "defs": { "main": { "type": "procedure",
"input": { "encoding": "application/json", "schema": { "type": "object", "properties": { "repo": { "type": "string" }, "collection": { "type": "string" }, "record": { "type": "unknown" } } } } } } } w ϦϙδτϦͷϨίʔυ ՃͷQSPDFEVSF w ߘϑΥϩʔͳͲର ͱͳΔSFDPSEΛͯ͠ ߦ͏ ˞ൈਮ
ߘ࡞ͷϦΫΤετ curl -X POST \ -H 'Authorization: Bearer ${accessJwt}' \
-H 'Content-Type: application/json' \ -d '{ "repo": "tester.bsky.social", "collection": "app.bsky.feed.post", "record": { "text": "Hello, world!", "createdAt": "2023-04-28T22:00:00+09:00" } }' \ 'https://bsky.social/xrpc/com.atproto.repo.createRecord'
ͦͷଞࡉ͔͍৭ʑ w SLFZBUBMJDFIPTUDPNJPFYBNQMFTPOHZ*D[DDQBͷ Z*D[DDQB w CMPCͷܕ͜ͷลΛࢀর w େഁյҎલͷσʔλSFGͱTJ[F͕ͳ͍ͷͰҙ w !BUQSPUPBQJͩͱࣗಈͰSFGͱTJ[FΛิ͢ΔΑ͏ʹͳ͍ͬͯΔ
w ΤϥʔϋϯυϦϯά͜͜Λࢀর
ิͱ͔ w ۦ͚Ͱ͢Έ·ͤΜʂ w ʮࠓͷൃදͳΜΘ͔ΒΜ͔ͬͨʯͱ͍͏ํNBUUO͞Μͷʰ։ൃ ࢹ͔ΒݟΔɺ৽͍͠ࢄܕ4/4ʮ#MVFTLZʯͱ"51SPUPDPMͷՄೳ ੑʱͱ͍͏هࣄνΣοΫͯ͠Έ͍ͯͩ͘͞ w IUUQTHJIZPKQBSUJDMFCMVFTLZBUQSPUPDPM
Ҏ্🫡