Security

Reply
New Contributor
Posts: 3
Registered: ‎06-29-2015

How to show non-tag attribute data and MoreFilterConditions not working

Our guest registration has a checkbox that is tied to the notes column on the backend. I need to be able to poll the ClearPass XML API to see if this this checkbox was checked or not when they signed in but I can't figure out how to view non-tag attributes.

 

I tried to do this in a hokey way by applying a filter criteria for this field and the guest name to see if I get a result back. But when I use the MoreFilterConditions tag I get an invalid XML error.

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<Filter entity="GuestUser">
<Criteria fieldName="name" filterString="fake.email@sharklasers.net" match="equals" />
<MoreFilterConditions fieldName="notes" fieldValue="1" match="equals" />
</Filter>
</TipsApiRequest>

 

What I'd really like to do is just search for a given guest and get all the data I want. How can I view data for a guest user that isn't in the tag dictionary for this entity? Do I need to create new tag definitions? Where would I do this? The API guide doesn't mention this at all and I've been unsuccessful in finding any mention of tags definitions in the documentation or the CPPM dashboard.

New Contributor
Posts: 3
Registered: ‎06-29-2015

Re: How to show non-tag attribute data and MoreFilterConditions not working

After re-reading the section on using multiple filters I realized that the MoreFilterConditions element needs to be nested inside Criteria.

 

That said I was able to get farther along but now I'm filtering based on the notes field but the API says it's not a field for GuestUsers but when I edit the export for guest users into a csv I see that field in the drop down. At this point I'm stuck in finding out how to make this data available in the API.

Community Administrator
Posts: 33
Registered: ‎11-01-2012

Re: How to show non-tag attribute data and MoreFilterConditions not working

I suggest that you use the new REST APIs instead of the XML or SOAP APIs. The REST APIs are the future of API access on ClearPass, and the API docs are built-in. Browse to https://<CPPM>/api-docs. I've also attached a rough draft of some notes that should help get you started.

 

As an  example, here's the data from a single guest account:

 

{
  "id": "3001",
  "username": "anonymous@anonymous.anon",
  "start_time": 1395854644,
  "expire_time": 0,
  "sponsor_name": "admin",
  "sponsor_profile": "1",
  "enabled": true,
  "current_state": "active",
  "notes": "Just some notes",
  "visitor_carrier": null,
  "role_name": "[Guest]",
  "role_id": 2,
  "email": "anonymous@anonymous.anon",
  "visitor_company": "anonymous",
  "do_expire": "0",
  "expire_postlogin": "0",
  "sponsor_profile_name": "IT Administrators",
  "visitor_name": "anonymous",
  "source": "create_user",
  "remote_addr": "199.127.104.10",
  "simultaneous_use": "0",
  "create_time": 1395854588,
  "expired_notify_status": "1",
  "_links": {
    "self": {
    "href": "https:\/\/cppm.anonymous.anon\/api\/guest\/3001"
    }
  }
},
New Contributor
Posts: 3
Registered: ‎06-29-2015

Re: How to show non-tag attribute data and MoreFilterConditions not working

I should have clarified in my original post that we are using 6.3.1. Is this only available in version 6.4 and above? When I go to that address I get redirected to the splash screen that shows different subsites.

Community Administrator
Posts: 33
Registered: ‎11-01-2012

Re: How to show non-tag attribute data and MoreFilterConditions not working

I should have been more specific as well. You will need at least 6.4 but I would recommend 6.5. Please keep in mind that there is no more development on the XML or SOAP APIs, though they are more complete at this point. All future API development will be on the REST API.

Search Airheads
Showing results for 
Search instead for 
Did you mean: