How to get the information of the user only by instance and token? #1077
Answered
by
neet
maodaisuki
asked this question in
Q&A
-
Hi, I am looking for a way to get the information of the user without accountid or username. Is it possiable to achieve that like the code below? const masto = createRestAPIClient({
url: instance,
accessToken: token
});
const account = masto.getAccount();
console.log(account.lastStatusAt); |
Beta Was this translation helpful? Give feedback.
Answered by
neet
Apr 20, 2024
Replies: 1 comment 1 reply
-
Hi @maodaisuki, You may want The corresponding API for it in Masto.js is masto.js/tests/rest/v1/accounts.spec.ts Lines 77 to 81 in b354d7a |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
maodaisuki
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @maodaisuki, You may want
/api/v1/accounts/verify_credentials
. See the documentation below:https://docs.joinmastodon.org/methods/accounts/#verify_credentials
The corresponding API for it in Masto.js is
masto.v1.accounts.verifyCredentials()
masto.js/tests/rest/v1/accounts.spec.ts
Lines 77 to 81 in b354d7a