cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1252
Views
0
Helpful
6
Replies
Highlighted
Beginner

MSE REST API client location question

I am testing MSE (version 8.0.130.0) REST API for client tracking.

 

I can get JSON objects back with "/api/contextaware/v1/location/clients", but have not found out how to track a single client at a time.

 

The documentation says that it is doable but never says how. I have copy-and-pasted the entirety of the API documentation below.

 

Does anyone have any insights? I've seen my own username in the bulk return. I've tried different ways to specify my username in the API call but all either failed with 404, or I just get the giant list.

 

Big thanks in advance!

----

locationclients

The location clients object returns the current location of the wireless client for the specified device ID. The ID can be MAC address, IP address, or Username.

HTTP Method

GET

Accepts

  • application/json
  • application/xml

Parameters

  • id—Mac address, IP Address, or Username of the wireless client.
  • Zones—Contains zone information for the selected location,

Response Types

  • XML and Json

Return Codes

  • 200—Successful response
  • 404—If there is no wireless client for the specified ID.No image with the specified imagename
  • 500—Server Error
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

OK, don't specify the parameter:

/api/contextaware/v1/location/clients/<username>

View solution in original post

6 REPLIES 6
Highlighted
VIP Advisor

I've not used the MSE REST API, but I reckon try the following, replacing <username> with your own:

/api/contextaware/v1/location/clients?id=<username>

cheers,

Seb.

Highlighted

I've tried that. It gives me a dump of all client location objects.

Highlighted

OK, don't specify the parameter:

/api/contextaware/v1/location/clients/<username>

View solution in original post

Highlighted

I've done that also:

2017-09-01 10:46:31 ERROR 404: Not Found.

I have tried many combinations of things.

Basically, if I do anything like "/?key=value" (as you normally see in a HTTP GET URL with parameters), I get the entire dump. If I don't use the "?" sign, I get 404.

Highlighted

The example column:

https://developer.cisco.com/site/cmx-mobility-services/tools/tutorials/mse-api-intro/#access-tracked-client-list-and-count-for-that-floor

https://64.103.26.61:443/api/contextaware/v1/location/clients/00:00:2a:01:00:09

...shows the query without a '?', just the value.

Certainly on the APIC-EM API which I have to hand, the following works (which has the same syntax):

/api/v1/network-device/80e5c0e8-cc82-46a3-b5d0-481c56766e29

Sounds like a bug to me.

Does using a MAC address like the Devnet example give a positive result?

 

cheers,

Seb.

Highlighted

I take my earlier response back.

/api/contextaware/v1/location/clients/<username>
/api/contextaware/v1/location/clients/<macaddress>

Both of those actually work. Not sure what happened in my earlier tests exactly, altough I only tried my own username -- I should have tried more than that, probably -- Also, my record today has the machine's hostname in the "userName" field. Maybe that's what threw me off.

Thank you for the support!

By the way, I also did find some sample Python code in Github.