GoAnywhere list users PYTHON (5 stars) code is here

Job ID: 38637141

Budget: $2 – $8 USD

Thank you for being here. Another post that I hope is easy?
Hello $10 milestone - do you have a Go Anywhere Server to test code?
I have some code I want to test out but do not have a test server and don't want to hit the live server?
Will give a 5 Star Review when this is done and will write such inspiring words for you, when done.

I change the base url / user / pass

import requests

# Configuration
base_url = 'https://your-goanywhere-instance.com/goanywhere/api/v1'
username = 'your_username'
password = 'your_password'

def authenticate():
"""Authenticate to the GoAnywhere API and return the session token."""
auth_url = f'{base_url}/login'
response = requests.post(auth_url, json={'username': username, 'password': password})

if response.status_code == 200:
return response.json().get('token')
else:
raise Exception("Authentication failed: " + response.text)

def list_users(token):
"""List all users."""
users_url = f'{base_url}/users'
headers = {'Authorization': f'Bearer {token}'}

response = requests.get(users_url, headers=headers)

if response.status_code == 200:
return response.json()
else:
raise Exception("Failed to retrieve users: " + response.text)

def main():
try:
token = authenticate()
users = list_users(token)

print("Users:")
for user in users:
print(f" - Username: {user['username']} (ID: {user['id']})")

except Exception as e:
print(f"Error: {e}")

if __name__ == '__main__':
main()

Please understand; there is hope you can give your “best” price; been unemployed, and have cancer with bills backing up, $10 possible? Please note $10 is the max total that I can handle for this (doing hourly reduces % fee). Will leave a Glowing paragraph of feedback 5 stars : - )

My funds are low but will pay quick and leave 5 stars. Please give your best possible for your bid ? (something reasonable?) Please note there is hope we can mutually complete this task; we can leave each other nice comments and 5 stars for each? Look at feedback on my profile, feedback I left for many others. Here is the project:

SINCERELY WOULD BE NICE TO MEET YOU PLEASE

ANY THOUGHTS ? Please note project is due in two hours as this projects deadline, as this is needed if we can get some done - then we can talk about next steps and 5 stars and another job also. If this is a good one and we are "successful"; would need a couple others setup, but will handle one at a time? Can you do this for something reasonable in a couple hours? thoughts ?