Glad it is resolved. Good job.
Original Message:
Sent: Jan 27, 2026 08:46 AM
From: cauliflower
Subject: AOS 8 API advice needed
Oh <facepalm> I was using "target_v4" and target_v6", it should be target-v4 and target-v6
Sigh. It now works. Thanks for taking a look both of you!
Original Message:
Sent: Jan 27, 2026 07:45 AM
From: GorazdKikelj
Subject: AOS 8 API advice needed
Hi Guy.
I don't know if it will help, but on GitHub you have AOS8 example scripts.
From error you will see that your json data is not in json format. Try using json.dumps() to convert dictionary to json string.
Best, Gorazd
------------------------------
Gorazd Kikelj
MVP Guru 2025
Original Message:
Sent: Jan 27, 2026 07:31 AM
From: cauliflower
Subject: AOS 8 API advice needed
I'm still stuck on this, but I did find this in the controller logs:
Jan 27 10:38:02 2026 webui[3604]: USER: username has logged in from 172.x.x.x.
Jan 27 10:38:02 2026 httpd[18031]: <350008> <18095> <ERRS> |httpd| |webserver| SSL Library Error: error:0A000126:SSL routines::unexpected eof while reading
Jan 27 10:38:02 2026 profmgr[3755]: <334200> <ERROR> |profmgr| Exception in py_set_config, TYPE: <type 'exceptions.ValueError'>:::EXCEP::: No JSON object could be decoded File pos: 88JSON File:
Jan 27 10:38:02 2026 profmgr[3755]: <334200> <ERROR> |profmgr| !! Traceback (most recent call last): !! File "./ds_py_intf.py", line 1123, in py_set_config !! File "/lib/python2.7/json/__init__.py", line 290, in load **kw) !! File "/lib/python2.7/json/__init__.py", line 351, in loads return cls(encoding=encoding, **kw).decode(s) !! File "/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) !! File "/lib/python2.7/json/decoder.py", li
Jan 27 10:38:02 2026 httpd[18031]: <350008> <18095> <ERRS> |httpd| |webserver| SSL Library Error: error:0A000126:SSL routines::unexpected eof while reading
Jan 27 10:38:02 2026 profmgr[3755]: <334200> <ERROR> |profmgr| Exception in py_set_config, TYPE: <type 'exceptions.ValueError'>:::EXCEP::: No JSON object could be decoded File pos: 88JSON File:
Jan 27 10:38:02 2026 profmgr[3755]: <334200> <ERROR> |profmgr| !! Traceback (most recent call last): !! File "./ds_py_intf.py", line 1123, in py_set_config !! File "/lib/python2.7/json/__init__.py", line 290, in load **kw) !! File "/lib/python2.7/json/__init__.py", line 351, in loads return cls(encoding=encoding, **kw).decode(s) !! File "/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) !! File "/lib/python2.7/json/decoder.py", li
So that explains why cURL works and running it from the controller API interface works, it's a Python problem? We run Python 3.x.
But strangely when I ran this with a different endpoint URL (apboot) it worked fine.
Does anyone have any ideas about what I might be doing wrong? Or is this a bug?
Original Message:
Sent: Jan 22, 2026 10:28 AM
From: cauliflower
Subject: AOS 8 API advice needed
Hello,
AOS 8.13.1.1
Multi-controller cluster and failover cluster with MCR and standby MCR (x2)
First off - I'm not very experienced with programming so I'm sure this is something I'm doing wrong rather than a bug etc!
I'm trying to use the API to run the 'apmove' command.
I successfully get the UIDARUBA and X-CRSF-Token (I'm a little confused about if and when I need the X-CSRF-Token but the API developer tool puts that in the header so I am too).
For info I can run this successfully from the API reference page using the 'Try It Out' option, so I know it is possible!
This is the relevant snip of what I have so far:
url = f"https://{ctlr_ip}:4343/v1/configuration/object/apmove_ap"
for ap in ap_list:
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
params = {"config_path":"/mm","UIDARUBA":str(uidaruba)}
querystring = urllib.parse.urlencode(params)
full_url = f"{url}?{querystring}"
print(f"full_url = {full_url}")
payload = {
"ap-mac": ap,
"target_v4": target_ip,
"target_v6": ''
}
print(f"payload = {payload}\n")
headers = {
"Content-Type": "application/json",
"X-CSRF-Token": x_csrf,
"Cookie" : f"SESSION={uidaruba}"
}
print(headers)
try:
response = requests.post(full_url, json=payload, headers=headers, verify=False)
print(response)
print(response.text)
But this is what I get when I run it (with some redactions):
full_url = https://<correct url>:4343/v1/configuration/object/apmove_ap?config_path=%2Fmm&UIDARUBA=<uid looks normal>
payload = {'ap-mac': 'AP MAC is correct', 'target_v4': 'cluster IP address', 'target_v6': ''}
{'Content-Type': 'application/json', 'X-CSRF-Token': '<x-csrf token>', 'Cookie': 'SESSION=<uid>'}
<Response [200]>
{
"Error": "Exception raised while processing request"
}
Is it true to say that authentication is working as I get a 200 response? In which case is the issue somehow with running the endpoint URL itself?
Any help much appreciated.
Guy
-------------------------------------------