-
Notifications
You must be signed in to change notification settings - Fork 0
API:Configure
Chris edited this page Nov 5, 2019
·
1 revision
This section of the API can only be performed by users with the ADMIN
permission. The only user that is automatically granted this permission is the Plex Server Owner. Any other user attempting to use the configuration endpoints will simply get an Unauthorized
response.
Every endpoint on the MediaButler Server is expected to be configurable. By querying the Version Endpoint you can obtain a list of the available endpoints loaded into the server. Expected URL structure is to be /configure/{{endpoint}}
For this example we will use the tautulli
endpoint.
Request:
curl --location --request GET "http://127.0.0.1:9876/configure/tautulli" \
--header "MB-Client-Identifier: 4d656446-fbe7-4545-b754-1adfb8eb554e" \
--header "Authorization: Bearer MB_TOKEN"
Replace MB_TOKEN
with the token obtained from Authentication
Response:
{
"schema": [
{
"name": "url",
"type": "url"
},
{
"name": "apikey",
"type": "secure-string"
}
],
"settings": {
"url": "http://127.0.0.1:8181/tautulli",
"apikey": "sdfdsfsfddgdgdfhghfghfggh"
}
}
Request:
curl --location --request PUT "http://127.0.0.1:9876/configure/tautulli" \
--header "Content-Type: application/json" \
--header "MB-Client-Identifier: 4d656446-fbe7-4545-b754-1adfb8eb554e" \
--header "Authorization: Bearer MB_TOKEN" \
--data "{
\"url\": \"http://127.0.0.1:8181/tautulli/\",
\"apikey\": \"sdfdsfsfddgdgdfhghfghfggh\"
}"
Response:
{
"message": "success",
"settings": {
"url": "http://127.0.0.1:8181/tautulli/",
"apikey": "sdfdsfsfddgdgdfhghfghfggh"
}
}
Request:
curl --location --request POST "http://127.0.0.1:9876/mediabutler/configure/tautulli" \
--header "Content-Type: application/json" \
--header "MB-Client-Identifier: 4d656446-fbe7-4545-b754-1adfb8eb554e" \
--header "Authorization: Bearer MB_TOKEN" \
--data "{
\"url\": \"http://127.0.0.1:8181/tautulli\",
\"apikey\": \"sdfdsfsfddgdgdfhghfghfggh\"
}"
Response:
{
"message": "success",
"settings": {
"url": "http://127.0.0.1:8181/tautulli",
"apikey": "sdfdsfsfddgdgdfhghfghfggh"
}
}