02-03-2018 11:35 AM - edited 02-03-2018 11:37 AM
Hello everyone, I was hoping to get a little guidance here. At work I was granted a test account to attempt to automate some IPAM tasks. However, while I am able to login to the GUI using the account and perform tasks i.e. create networks, add hosts, etc, with no problems, I am not able to send the same commands with the same credentials using the API. Regardless of the task, it always returns the same message. I am using vbscript to send the commands which I know to have worked in past jobs with no issues. A simple example such as the one below renders the same message:
Set WAPI = CreateObject("Msxml2.ServerXMLHTTP")
WAPI.setOption 2, 13056
userName = "ipam_api"
password = "api_password"
URL = "https://ipam.mynet.com/wapi/v1.0/?_schema"
WAPI.open "GET", URL, false, userName, password
WAPI.setRequestHeader "Accept", "application/json"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title>401 Authorization Required</title>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
Please advise if there is something that I may be overlooking.
Solved! Go to Solution.
02-03-2018 10:57 PM
API access also needs to be enabled for the group that your user account is a member of. To verify this, an administrator who has the ability to manage groups in NIOS will want to edit the properties for the group and in the Roles tab, scroll down to the bottom. You should see an "Allowed Interfaces" section, and the API option will need to be enabled. The default options from there should work for your testing