Date: Fri, 29 Mar 2024 14:17:23 +0000 (GMT) Message-ID: <90589687.3416.1711721843622@a2be6a7a0dbc> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3415_1752702638.1711721843621" ------=_Part_3415_1752702638.1711721843621 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
CNaaS NAC exposes a standard REST-like JSON API. In these exampl= es we will use curl to do some basic operations.
This API uses the TCP port 5001 for communication.
curl -X GET http://localhost:5001/api/v1.0/auth
curl -X GET http://localhost:5001/api/v1.0/auth/foo = # Where 'foo' is the username
This POST method will accept JSON input with the following fields:
curl --header "Content-Type: application/json" -X POST --data '{"usern= ame":"foo","password":"bar","vlan":111}' http://localhost:500= 1/api/v1.0/auth
This method uses the same input data as add users. But will utilise the = username in the URL.
curl --header "Content-Type: application/json" -X PUT --data '{"passwo= rd":"baz","vlan":222}' http://localhost:5001/api/v1.0/auth/foo
Once again we will pass the username in the URL.
curl -X DELETE http://localhost:5001/api/v1.0/auth/f= oo