Security

Reply
Occasional Contributor I
Posts: 8
Registered: ‎09-28-2016

Clearpass API Guestmanager add a new device

I am currently trying to use ClearPass API to view and create new devices under GuestManager. However I am having issues with simply trying to "post" to /api/device endpoint. I am using advanced rest client in order to test

 

Headers

Authorization: Bearer <access token>

Content-Type: application/json

 

Body

{
"sponsor_name": "name", //same as logged in user
"mac": "00-00-00-00-00-01",

"username": "00-00-00-00-00-01", // explorer says to use mac
"source":"mac_create",
"visitor_name": "visitor name " //field used as a label in device table
}

 

Biggest problem is that in the API explorer all the fields say "optional" so I am not sure which ones I need to specify. 

 

The access token is valid, I can make a "get" request to /device and see all the devices listed. When I try to post, the repsonse is 200 with no error or any responses. But when I go to  Guest > Manage Devices the device is not listed in the table. I can use the "add device" button found on that page which works as expected but cant seem to get the API to work

 

I might be missing something simple but I am not sure what. Any help would be appreciated. 

 

Thanks,

Monil 

Guru Elite
Posts: 8,755
Registered: ‎09-08-2010

Re: Clearpass API Guestmanager add a new device

Below is a sample payload.

So this will create a new device account with role ID 16, with no expiration and a device nickname of iap205h-br.

 

{
  "enabled": true,
  "expire_time": "0",
  "mac": "000b86f5fb22",
  "notes": "",
  "role_id": 16,
  "visitor_name": "iap205h-br"
}

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Occasional Contributor I
Posts: 8
Registered: ‎09-28-2016

Re: Clearpass API Guestmanager add a new device

The server responds with a 200 OK, but the response contains no data and no device is created.

 

I am sending:

HEADERS

Authorization: Bearer <actual token>
Content-Type:application/json

BODY

{
"enabled": true,
"expire_time": "0",
"mac": "000b86f5fb22",
"notes": "",
"role_id": 13,
"visitor_name": "iap205h-br"
}

Guru Elite
Posts: 8,755
Registered: ‎09-08-2010

Re: Clearpass API Guestmanager add a new device

You need to adapt the payload to your environment. You likely don't have a
role 13.

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Guru Elite
Posts: 8,755
Registered: ‎09-08-2010

Re: Clearpass API Guestmanager add a new device

You need to adapt the payload to your environment. You likely don't have a
role 13.

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Occasional Contributor I
Posts: 8
Registered: ‎09-28-2016

Re: Clearpass API Guestmanager add a new device

Right. I've been trying to figure out the Role ID of the Operator Profile we want to use.

1.) Am I correct in thinking that role_id -> Operator Profile

2.) How can I find the proper IDs to use?

Occasional Contributor I
Posts: 8
Registered: ‎09-28-2016

Re: Clearpass API Guestmanager add a new device

also I am trying to use operator profile Device Registration, so I set up the API client with that profile and gave api access to it with no luck. I can still get a list of devices, but not create a new one through the API,

 

not sure if I am missing a step with setting up the API client. 

Guru Elite
Posts: 8,755
Registered: ‎09-08-2010

Re: Clearpass API Guestmanager add a new device

For device registration, role ID is used for role based access for the
device you're registering. Some examples include "Media Player", "Game
Console", "Printer", "Camera", etc. You map these roles to a number in the
[Guest Roles] role map in policy manager.

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Guru Elite
Posts: 8,755
Registered: ‎09-08-2010

Re: Clearpass API Guestmanager add a new device

Please describe your complete scenario or reach out to your Aruba ClearPass
Partner.

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Guru Elite
Posts: 8,755
Registered: ‎09-08-2010

Re: Clearpass API Guestmanager add a new device

Please describe your complete scenario or reach out to your Aruba ClearPass
Partner.

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Search Airheads
Showing results for 
Search instead for 
Did you mean: