mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-18 09:26:17 +00:00
Update documentations
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# API Documents for WGDashboard
|
||||
# 📖 API Document for WGDashboard
|
||||
|
||||
**Version: v4.0**
|
||||
|
||||
@@ -6,3 +6,21 @@
|
||||
|
||||
<hr>
|
||||
|
||||
## 🔑 How to use API Key?
|
||||
|
||||
### Create API Key
|
||||
|
||||
1. To request an API Key, simply login to your WGDashboard, go to **Settings**, scroll to the very bottom. Click the **switch** on the right to enable API Key.
|
||||
2. Click the blur **Create** button, set an **expiry date** you want or **never expire**, then click **Done**.
|
||||
|
||||
### Use API Key in `fetch()`
|
||||
|
||||
```javascript
|
||||
fetch('http://server:10086', {
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'wg-dashboard-apikey': 'insert your api key here'
|
||||
}
|
||||
})
|
||||
```
|
||||
To use API Key, simply insert `wg-dashboard-apikey` with the value of your API key into the `header` in your http request.
|
||||
|
||||
Reference in New Issue
Block a user