asudox@lemmy.world to No Stupid Questions@lemmy.world · edit-23 months ago[ANSWERED] How do you get the ID of the owner of a lemmy community via the API?message-squaremessage-square8fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1message-square[ANSWERED] How do you get the ID of the owner of a lemmy community via the API?asudox@lemmy.world to No Stupid Questions@lemmy.world · edit-23 months agomessage-square8fedilink
minus-squareoriginalucifer@moist.catsweat.comlinkfedilinkarrow-up0·3 months agoo0o sorry, missed that bit!
minus-squareasudox@lemmy.worldOPlinkfedilinkarrow-up0·3 months agoYou didn’t miss it. I forgot to include it, sorry.
minus-squareAdmiral Patrick@dubvee.orglinkfedilinkEnglisharrow-up0·edit-23 months ago/api/v3/community It’ll respond with an object of GetCommunityResponse (https://join-lemmy.org/api/interfaces/GetCommunityResponse.html) The moderators array will have an array of objects of which moderator is a Person type. The “top mod” is also the owner, and they’ll always be the first entry in the moderators array from /api/v3/community const comunityDetails = await fetch('https://intance.xyz/api/v3/community?community_id=12345) const owner = communityDetails.moderators[0].moderator.id
minus-squareasudox@lemmy.worldOPlinkfedilinkarrow-up0·3 months agoOh great. So it preserves the order. Thanks.
minus-squareAdmiral Patrick@dubvee.orglinkfedilinkEnglisharrow-up0·3 months agoYes, mostly. I’ve seen cases where TransferCommunity events aren’t federated, so the correct order is only guaranteed if you query the home instance for the community. (Assuming community transfer events are even supposed to federate, that is).
Via the API.
o0o sorry, missed that bit!
You didn’t miss it. I forgot to include it, sorry.
/api/v3/community
It’ll respond with an object of
GetCommunityResponse
(https://join-lemmy.org/api/interfaces/GetCommunityResponse.html)The
moderators
array will have an array of objects of whichmoderator
is aPerson
type.The “top mod” is also the owner, and they’ll always be the first entry in the
moderators
array from/api/v3/community
const comunityDetails = await fetch('https://intance.xyz/api/v3/community?community_id=12345) const owner = communityDetails.moderators[0].moderator.id
Oh great. So it preserves the order. Thanks.
Yes, mostly.
I’ve seen cases where
TransferCommunity
events aren’t federated, so the correct order is only guaranteed if you query the home instance for the community.(Assuming community transfer events are even supposed to federate, that is).
Got it.