Smart+Connected Digital Platform API - Retrieving Additional Information from the Smart+Connected Digital Platform API

Objectives

  • Explore additional information that can be obtained from the Smart+Connected Digital Platform APIs
  • Building upon the previous lab, CDP 101, you will use the information you retrieved from Smart+Connected Digital Platform to make two additional Smart+Connected Digital Platform API requests.
    • Retrieve the Location Information for the logged in user. This will return all of the Smart+Connected Digital Platform Locations that this user has access to.
    • Retrieve the Capabilities of this Smart+Connected Digital Platform instance. This will provide us with information about the domains that are available on a specific Smart+Connected Digital Platform instance for a specific customer.

You can download the complete sample code project for this lab on GitHub: CiscoDevNet/scc-cdp-api-examples

Overview

Cisco Smart+Connected Digital Platform is a platform providing a rich API for retrieving information from connected cities and device collections. This includes sensor data as well as information about users, locations and capabilities of the current instance of the Cisco Smart+Connected Digital Platform. The API provides access to both real time and historical data from the connected sensors and devices.

In this lab we will retrieve additional information about the locations available to the current user and about the capabilities of the Smart+Connected Digital Platform instance itself.

You can find documentation other information on the Cisco Smart+Connected Digital Platform DevNet Site

In order to complete this lab, you will need to make a reservation to access the Smart+Connected Digital Platform sandbox instance. You can make a reservation on the Cisco Smart+Connected Digital Platform DevNet sandbox page.

Smart+Connected Digital Platform API Requirements

All Smart+Connected Digital Platform APIs (except authentication) require access tokens. Before any of these APIs can be used, you must authenticate with Smart+Connected Digital Platform to get the tokens needed to make successful calls. You will also need the userId and customerId returned in the 2nd API request in the previous lab. See CDP 101 for information about authentication and retrieving the data needed for this lab:

  1. api_access_token
  2. app_access_token
  3. userId
  4. customerId

Lab Overview

We will examine a small sample Python script that demonstrates two Smart+Connected Digital Platform API requests:

  1. The /locations/userinfo/user/\ API returns the locations available to the current user
  2. The /capabilities/customer/\ API returns the domains available to the current customer for the Smart+Connected Digital Platform instance.

This Learning Lab is comprised of two API calls:

  1. Retrieve Location Information
    • Make a GET Request to the /locations/userinfo/user/\ Smart+Connected Digital Platform API, specifying the current user
    • Print the response to see the location information returned from the Smart+Connected Digital Platform API
  2. Retrieve Capabilities Information
    • Make a GET Request to the /capabilities/customer/\ Smart+Connected Digital Platform API
    • Print the response to see the available domains