API

Using Rest APIs

You can use REST APIs to retrieve, add, or modify information on Cisco Spaces: Detect and Locate. The REST APIs are divided into five categories:

  • Active clients’ location APIs: APIs to retrieve client count and location data.

  • Clients location history APIs: APIs to get a MAC address and the details for a given device.

  • Notifications APIs: APIs for subscription-based notifications.

  • Map APIs: APIs to upload, navigate the maps hierarchy, retrieve, and delete a map element.

  • Access point APIs: APIs to get access point details.

API Key

To use REST APIs, you must generate an API Key. An API key is a Cisco-proprietary JSON Web Token (JWT) that is required in each HTTP request header to authenticate and authorize users.

You can generate an API Key from Cisco Spaces: Detect and Locate. Navigate to Notifications > API Keys and then click Add. You are prompted to configure the number of days after which the key should expire. Valid range is between 7 days and 365 days. After the key is generated, ensure that it is stored safely.

Figure 1. API Keys

The API Keys window shows the key names (only partially displayed), the date and time at which they were created, the date and time at which they are going to expire, and email IDs of the users who created the keys. To delete a key, click on the three dots icon in the Actions column and then click Delete. If you delete a key, the key is not revoked and you can still use it until its expiry date and time.


Note


The API key is visible only at creation time, and hence must be stored securely. Cisco Spaces: Detect and Locate does not save the API key values. Each authenticated user can have up to five keys.
Figure 2. Copy the API Key

The following is an example from the POSTMAN client, where an API key has been used as an Authorization header.

Figure 3. API Keys