Question: how to fetch information about a user #821
-
Hi, For my bot, I republish changes that have been made on OpenStreetMap automatically and I do ping people if they have their Mastodon set on OpenStreetMap. However, I don't want to ping people who indicate that they don't like bots. They do this by setting the "no-bot"-field on their profile. However, I'm struggling to fetch the profile of a user. I tried What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
According to the Mastodon doc:
Therefore the If you don't know the ID of the target account or don't want to hard-code the ID, you might be able to use const acct = await masto.v1.accounts.lookup({
acct: '@[email protected]',
});
console.log(`ID: ${acct.id}`); I hope this helps |
Beta Was this translation helpful? Give feedback.
According to the Mastodon doc:
Therefore the
id
parameter is the ID of the account which is different from a username. It consists of 18 digits of integer and should look like109385598812984542
. The value is different in each instance because each instance has its own database.If you don't know the ID of the target account or don't want to hard-code the ID, you might be able to use
v1.accounts.lookup
for getting a profile from the username. c.f.I hope this h…