Hi, when i make an new user, everything works fine without issues.
Code:
from pydactyl import PterodactylClient
# Create a client to connect to the panel and authenticate with your API key.
api = PterodactylClient('http://10.10.10.5/', 'API key here!')
result = api.user.create_user('test', 'test212@gmail.com', 'Test21', 'Name')
user_id = result['attributes']['id']
api.user.get_user_info(user_id)
{'object': 'user', 'attributes': {'id': 14, 'external_id': None}}
But when i use:
from pydactyl import PterodactylClient
# Create a client to connect to the panel and authenticate with your API key.
api = PterodactylClient('http://10.10.10.5/', 'API key here!')
# Get a list of all servers the user has access to
my_servers = api.client.servers.list_servers()
# Get the unique identifier for the first server.
srv_id = my_servers[0]['attributes']['identifier']
# Check the utilization of the server
srv_utilization = api.client.servers.get_server_utilization(srv_id)
print(srv_utilization)
# Turn the server on.
api.client.servers.send_power_action(srv_id, 'start')
I get:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://10.10.10.5/api/client
Hi, when i make an new user, everything works fine without issues. Code:
But when i use:
I get:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://10.10.10.5/api/client
I have everything on read/write. Can you help me?