cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2123
Views
0
Helpful
6
Replies

MSE REST API client location question

ww9rivers
Level 1
Level 1

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

OK, don't specify the parameter:

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

View solution in original post

6 Replies 6

Seb Rupik
VIP Alumni
VIP Alumni

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.

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

OK, don't specify the parameter:

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

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.

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.

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: