API connection #14218
-
How can I get the API key to read and write? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
https://misskey-hub.net/en/docs/for-developers/api/token/ Obtain an access tokenTo get started with the API, you first need to get an access token tied to the account you want to use. Generally, API requests require an access token. An access token is authentication information linked to a user, which identifies the user utilizing the API and manages the permissions associated with each access token. Tip A user and their associated access tokens have a one-to-many relationship, meaning multiple access tokens can be issued for a single user. You can easily obtain your own access token, and you can also obtain access tokens for users who will be using your application.
Manually Issuing Your Own Access TokenYou can issue your access token in Misskey Web under "Settings > API". Warning Make sure to keep your access token confidential and do not share it with others. Requesting Access Tokens for Application UsersTo obtain access tokens for users who will be using your application (hereinafter simply referred to as "users"), use one of the following methods: https://misskey-hub.net/en/docs/for-developers/api/token/ Using the APIOnce you have obtained an access token, you can use the API by making requests to various endpoints. Tip
Using the Authorization HeaderInstead of using fetch("https://misskey.io/api/notes/create", {
method: 'POST',
body: JSON.stringify({
text: "Hello Misskey API World with My Application!"
}),
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
credentials: 'omit',
}); Using the
|
Beta Was this translation helpful? Give feedback.
https://misskey-hub.net/en/docs/for-developers/api/token/
(Most of the information of misskey can be found on misskey-hub.net)
Obtain an access token
To get started with the API, you first need to get an access token tied to the account you want to use.
This document describes the steps to get an access token and then the basic API usage.
Generally, API requests require an access token. An access token is authentication information linked to a user, which identifies the user utilizing the API and manages the permissions associated with each access token.
Tip
A user and their associated access tokens have a one-to-many relationship, meaning multiple access tokens can be issued for a singl…