Hey, not sure if a solution was ever shared for this but here's what I found. In addition to generating and using an Activate token, I found that when using Python, I needed to included the json payload as raw data in the body of the request while specifying the content type as "application/x-www-form-urlencoded".
Here's an example of the Python code that worked for me. This is example is just querying the Activate inventory but it also works similarly for other Activate APIs for updating inventory, mass device moves, renaming, data collection, etc.
import requests
# First request is login and save cookie, as the Activate documentation state, the username can be anything or blank. the important part is the token
login_url = "https://activate.arubanetworks.com/LOGIN"
login_data = {
'credential_0': 'could_be_anything',
'credential_1': 'yourActivateTokenHere'
}
# Create a session to persist cookies
session = requests.Session()
response = session.post(login_url, data=login_data)
print(f"Login Status Code: {response.status_code}")
# Second request - query inventory
inventory_url = "https://activate.arubanetworks.com/api/ext/inventory.json?action=query"
# Send as raw string
#raw_data = 'json={ "folders" : ["123456"] }' ## example if you wanted to query a folder or folders
raw_data = 'json={ "serialNumbers" : ["SN012345"] }'
print(f"Data length: {len(raw_data)}")
print(f"Data: {raw_data}")
response = session.post(
inventory_url,
data=raw_data,
headers={'Content-Type': 'application/x-www-form-urlencoded'}
)
print(f"Response Status Code: {response.status_code}")
print(f"Response Content:\n{response.text}")
-------------------------------------------
Original Message:
Sent: Aug 01, 2023 05:49 AM
From: Gonz
Subject: Aruba Activate API
Never mind after fiddling around for a long time I finaly tested out using token instead of password and now it works as expected.
https://support.hpe.com/hpesc/public/docDisplay?docId=a00120791en_us&page=GUID-57DE7B17-AC32-45E4-98DF-03A3F26C0279.html
Any one knows how the cert is pushed to IAPs though ? Would be nice to have more details regarding this.
Original Message:
Sent: Aug 01, 2023 05:24 AM
From: Gonz
Subject: Aruba Activate API
Hi!
I'm trying to figure out how to setup IAP-VPN to virtual controller for a lab. But I get stuck since I cannot find any detailed documentation on this.
Basically all I find is this:
"Starting from Aruba Instant 8.3.0.0, IAP- is supported on Mobility Controller Virtual Appliance by using default self-signed certificate (Aruba ). For Instant AP to establish connection with Mobility Controller Virtual Appliance, the controller presents a default self-signed certificate which is uploaded on the Instant AP using Activate.
To terminate IAP- connections on a Mobility Controller Virtual Appliance , the default self signed certificate or Trust Anchor (TA) certificate of the Virtual Mobility Controller in the case of standalone controllers or the TA certificate of the Virtual Mobility Conductor that manages the Virtual Mobility Controller must be uploaded to the Instant AP to authenticate the identity of the Mobility Controller Virtual Appliance and establish an tunnel. The Trust Anchor certificate must be uploaded to Activate which will then be sent to the Instant AP, to authenticate and establish an tunnel to virtual controller.
For information on uploading and managing TA certificates on Activate for IAP- termination on Mobility Controller Virtual Appliances, see Aruba Activate section in the Aruba Activate User Guide."
Configuring Controller for IAP-VPN Operations
I figured I'll test it out even though it's not very clear on what to do.
But when trying to access the API , I get error 403, Forbidden.
I'm using my normal login credentials that has access to activate.
Anyone knows how to use the activate API and/or how to get virtual Controller and IAP-VPN running ?
Tested with postman and curl:
curl -d "credential_0=${actusername}&credential_1=${actpassword}" -c Activate-cookie.txt -v https://activate.arubanetworks.com/LOGIN --trace /dev/stdout

https://support.hpe.com/hpesc/public/docDisplay?docId=a00120791en_us&page=GUID-538FAA17-AFA9-4F3E-A4C4-76532B0D15B6.html