Actualizar 'README.md'
This commit is contained in:
pare
da74edd8c3
commit
56d84f728a
S'han modificat 1 arxius amb 41 adicions i 0 eliminacions
41
README.md
41
README.md
|
@ -1,5 +1,46 @@
|
|||
# MisskeyAPI
|
||||
|
||||
Sample usage:
|
||||
|
||||
```
|
||||
from misskeyapi import MisskeyAPI
|
||||
|
||||
misskey = MisskeyAPI()
|
||||
|
||||
app_secret = misskey.app_create(
|
||||
app_name,
|
||||
description,
|
||||
permission,
|
||||
callbackUrl
|
||||
)
|
||||
|
||||
response = misskey.auth_session_generate(app_secret)
|
||||
|
||||
if response.ok:
|
||||
|
||||
token = response.json()['token']
|
||||
url = response.json()['url']
|
||||
input(f'open this url in your browser: {url} and accept it. Then press enter')
|
||||
|
||||
else:
|
||||
|
||||
print(response)
|
||||
|
||||
response = misskey.auth_session_userkey(app_secret, token)
|
||||
|
||||
if response.ok:
|
||||
|
||||
token = response.json()['accessToken']
|
||||
|
||||
else:
|
||||
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
Store or write down in a safe place the obtained `token` to further usage with any of the API endpoints that require it.
|
||||
|
||||
|
||||
|
||||
Python wrapper for Miskkey API
|
||||
| **description** | **Misskey API endpoint** | **method** | **params** |
|
||||
|-----------------------|----------------------------|-----------------------|-----------------------------------------------------|
|
||||
|
|
Loading…
Referencia en una nova incidència