rtgrete


Welcome to the API Getting Started Guide

What This API Does

The Smartylighting Streetlights API allows you to remotely manage the city lights. This API provides a set of endpoints that allow developers to interact with our platform programmatically. It is designed to facilitate seamless integration with your applications, enabling you to automate tasks, retrieve data, and enhance your application's functionality. Whether you're building a new app or enhancing an existing one, this API offers the tools you need to succeed.

Check out its awesome features:

  • Turn a specific streetlight on/off 🌃
  • Dim a specific streetlight 😎
  • Receive real-time information about environmental lighting conditions 📈

Why It's Useful

By using this API, you can save time and resources by automating repetitive tasks, accessing real-time data, and integrating our platform's capabilities directly into your application. This allows you to focus on building unique features and improving user experience, while leveraging the robust infrastructure and services we provide.

Prerequisites

  • Basic understanding of RESTful APIs and HTTP methods.
  • Familiarity with JSON format for request and response payloads.
  • Access to a development environment with internet connectivity.
  • API key or credentials for authentication (see Authentication section below).
  • For the Streetlights Kafka API, familiarity with Kafka concepts and client libraries is recommended.

Resources and Capabilities

ResourceCapabilities
Streetlights (Kafka)Inform about environmental lighting conditions (publish), Command to turn on/off, Command to dim light (subscribe)
Devices (Home IoT)Retrieve all registered devices, Register new devices
Lighting Dimmers (Home IoT)Set dimmer value, Set dimmer value on a timer
Lighting Switches (Home IoT)Get switch state, Set switch state, Set switch state on a timer
Lighting Summary (Home IoT)Get overall lighting summary
Temperature (Home IoT)Get temperature summary, Get temperature forecast, Get zone temperature, Get heater state, Set heater state
Zones (Home IoT)Get all zones, Quiet a specific zone
Pet (Petstore)Add new pet, Update existing pet, Find pets by status, Find pets by tags, Find pet by ID, Update pet with form data, Delete pet, Upload image for pet
Store (Petstore)Returns pet inventories by status, Place an order for a pet, Find purchase order by ID, Delete purchase order by ID
User (Petstore)Create user, Create list of users, Login user, Logout user, Get user by user name, Update user, Delete user

Authentication

To access the API, you must authenticate your requests. The Streetlights Kafka API uses SASL/SCRAM authentication. For the Home IoT API and Petstore API, authentication methods vary:

Streetlights Kafka API Authentication (SASL/SCRAM)

Provide your username and password for SASL/SCRAM authentication when connecting to the Kafka broker. The test broker is located at test.mykafkacluster.org:8092.

    // Example (conceptual, depends on your Kafka client library)
    // KafkaProducer or KafkaConsumer configuration
    // 'sasl.mechanism': 'SCRAM-SHA-256'
    // 'sasl.jaas.config': 'org.apache.kafka.common.security.scram.ScramLoginModule required username="YOUR_USERNAME" password="YOUR_PASSWORD";'
    

Home IoT API Authentication

The provided Home IoT API definition does not explicitly define security schemes. Please refer to the specific documentation for the Home IoT API for details on how to authenticate your requests.

Petstore API Authentication

The Petstore API uses two primary authentication methods:

OAuth2 (petstore_auth)

This is an OAuth2 implicit flow. You will need to obtain an access token from the authorization URL and include it in your requests. The scopes available are write:pets (modify pets in your account) and read:pets (read your pets).

    Authorization: Bearer YOUR_ACCESS_TOKEN
    

API Key (api_key)

Some operations require an API key, which should be included in the header of your request.

    api_key: YOUR_API_KEY
    

Ensure that your API keys and credentials are kept secure and not exposed in client-side code or public repositories. If you suspect your key has been compromised, regenerate it immediately through your account settings.

Getting Started

To begin using the API, follow these steps:

  1. Obtain your API key/credentials from the developer portal or follow the authentication steps for each specific API.
  2. Set up your development environment and ensure you have the necessary dependencies installed (e.g., Kafka client libraries for the Streetlights API).
  3. Review the API documentation to understand the available endpoints and their capabilities.
  4. Start making requests to the API using your preferred programming language or tool.

We hope this guide helps you get started quickly and effectively. For further assistance, please refer to our detailed API documentation or contact our support team.