How to get UserHandle by CID/URI ? #1883
-
Hi, via the firehose API I got a JSON Object which looks like the one below for example - how can I get the UserHandle of this Skeet via atproto? Any help greatly appreciated.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can't find the identity which created this post from just the record, you need the other metadata from the Starting from a DID, you can resolve the identity metadata by resolving the DID document (either did:plc or did:web), extracting any handle for the account, and resolving the handle to confirm it is valid (points back to the correct DID). Usually a service would use a library to do this identity resolution, and also cache things locally for up to 24 hours to reduce the number of network requests. |
Beta Was this translation helpful? Give feedback.
-
1st and foremost Thank you for your answer although I admit that I did understand perhaps 50% ;-). I am wondering how Firesky does realize this for example. Caching is not an option. So bluntly atproto does not offer any solution via API to get it (which is not rate limited in the end). |
Beta Was this translation helpful? Give feedback.
You can't find the identity which created this post from just the record, you need the other metadata from the
#commit
message on the event stream. Specifically, therepo
field of thecom.atproto.sync.subscribeRepos#commit
message is the DID of the repo (DID of the account).Starting from a DID, you can resolve the identity metadata by resolving the DID document (either did:plc or did:web), extracting any handle for the account, and resolving the handle to confirm it is valid (points back to the correct DID). Usually a service would use a library to do this identity resolution, and also cache things locally for up to 24 hours to reduce the number of network requests.