GoScrobble/docs/api/source/includes/_admin.md
2021-12-25 17:27:35 +13:00

1.5 KiB

Admin Endpoints

GET v1/config

Fetch configuration values:

curl "https://goscrobble.com/api/v1/config" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6ZmFsc2UsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsImV4cCI6MTY0MTAwMjUxOSwiaWF0IjoxNjQwMzk3NzE5LCJtb2QiOnRydWUsI"

Response:

{
  "SPOTIFY_API_ID": "abc",
  "SPOTIFY_API_SECRET": "def",
  "REGISTRATION_ENABLED": true
}

Fetch instance configuration values.

HTTP Request

GET https://goscrobble.com/api/v1/config

POST v1/config

Update a configuration parameter:

curl "https://goscrobble.com/api/v1/config" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6ZmFsc2UsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsImV4cCI6MTY0MTAwMjUxOSwiaWF0IjoxNjQwMzk3NzE5LCJtb2QiOnRydWUsI" \
  -X POST \
  --data '{"SPOTIFY_API_ID":"notarealapikey","SPOTIFY_API_SECRET":"notarealsecret"}'

Response:

{
  "message": "Config updated successfully"
}

Updates instance configuration values.

HTTP Request

POST https://goscrobble.com/api/v1/config

Query Parameters

Parameter Required Description
key true Array of key/value pairs to update. See example.