Getting started with WEKA REST API
Access the REST API


Explore the REST API through the GUI

Obtain an access token
Call the REST API
Last updated



Last updated
import requests
url = "https://weka01:14000/api/v2/login"
payload="{\n \"username\": \"admin\",\n \"password\": \"admin\"\n}"
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
url = "https://weka01:14000/api/v2/login/refresh"
payload="{\n \"refresh_token\": \"REPLACE-WITH-REFRESH-TOKEN\"\n}"
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"data": [
{
"access_token": "ACCESS-TOKEN",
"token_type": "Bearer",
"expires_in": 300,
"refresh_token": "REFRESH-TOKEN"
}
]
}import requests
url = "https://weka01:14000/api/v2/cluster"
payload={}
headers = {
'Authorization': 'Bearer REPLACE-WITH-ACCESS-TOKEN'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)