

# Connect to Amazon IoT Core service endpoints
<a name="iot-connect-service"></a>

You can access the features of the **Amazon IoT Core - control plane** by using the Amazon CLI, the Amazon SDK for your preferred language, or by calling the REST API directly. We recommend using the Amazon CLI or an Amazon SDK to interact with Amazon IoT Core because they incorporate the best practices for calling Amazon services. Calling the REST APIs directly is an option, but you must provide [the necessary security credentials](https://docs.amazonaws.cn//general/latest/gr/signing_aws_api_requests.html) that enable access to the API.

**Note**  
IoT devices should use [Amazon IoT Device SDKs](iot-connect-devices.md#iot-connect-device-sdks). The Device SDKs are optimized for use on devices, support MQTT communication with Amazon IoT, and support the Amazon IoT APIs most used by devices. For more information about the Device SDKs and the features they provide, see [Amazon IoT Device SDKs](iot-connect-devices.md#iot-connect-device-sdks).  
Mobile devices should use [Amazon Mobile SDKs](#iot-connect-mobile-sdks). The Mobile SDKs provide support for Amazon IoT APIs, MQTT device communications, and the APIs of other Amazon services on mobile devices. For more information about the Mobile SDKs and the features they provide, see [Amazon Mobile SDKs](#iot-connect-mobile-sdks).

You can use Amazon Amplify tools and resources in web and mobile applications to connect more easily to Amazon IoT Core. For more information about connecting to Amazon IoT Core by using Amplify, see [PubSub](https://docs.amplify.aws/react/build-a-backend/add-aws-services/pubsub/) in the Amplify documentation.

The following sections describe the tools and SDKs that you can use to develop and interact with Amazon IoT and other Amazon services. For the complete list of Amazon tools and development kits that are available to build and manage apps on Amazon, see [Tools to Build on Amazon](https://aws.amazon.com/tools/).

## Amazon CLI for Amazon IoT Core
<a name="iot-connect-cli"></a>

The Amazon CLI provides command-line access to Amazon APIs.
+ 

**Installation**  
For information about how to install the Amazon CLI, see [Installing the Amazon CLI](https://docs.amazonaws.cn//cli/latest/userguide/cli-chap-install.html).
+ 

**Authentication**  
The Amazon CLI uses credentials from your Amazon Web Services account.
+ 

**Reference**  
For information about the Amazon CLI commands for these Amazon IoT Core services, see:
  + [Amazon CLI Command Reference for IoT](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iot/index.html)
  + [Amazon CLI Command Reference for IoT data](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iot-data/index.html)
  + [Amazon CLI Command Reference for IoT jobs data](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iot-jobs-data/index.html)
  + [Amazon CLI Command Reference for IoT secure tunneling](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iotsecuretunneling/index.html)

For tools to manage Amazon services and resources in the PowerShell scripting environment, see [Amazon Tools for PowerShell](https://aws.amazon.com/powershell/).

## Amazon SDKs
<a name="iot-service-sdks"></a>

With Amazon SDKs, your apps and compatible devices can call Amazon IoT APIs and the APIs of other Amazon services. This section provides links to the Amazon SDKs and to the API reference documentation for the APIs of the Amazon IoT Core services. 

**The Amazon SDKs support these Amazon IoT Core APIs**
+ [Amazon IoT](https://docs.amazonaws.cn//iot/latest/apireference/welcome.html)
+ [Amazon IoT Data Plane](https://docs.amazonaws.cn//iot/latest/apireference/welcome.html)
+ [Amazon IoT Jobs Data Plane](https://docs.amazonaws.cn//iot/latest/apireference/welcome.html)
+ [Amazon IoT Secure Tunneling](https://docs.amazonaws.cn//iot/latest/apireference/welcome.html)
+ [Amazon IoT Wireless](https://docs.amazonaws.cn/iot-wireless/latest/apireference/welcome.html)

------
#### [ C\+\+ ]

**To install the [Amazon SDK for C\+\+](https://aws.amazon.com/sdk-for-cpp/) and use it to connect to Amazon IoT:**

1. Follow the instructions in [Getting Started Using the Amazon SDK for C\+\+](https://docs.amazonaws.cn/sdk-for-cpp/v1/developer-guide/getting-started.html)

   These instructions describe how to:
   + Install and build the SDK from source files
   + Provide credentials to use the SDK with your Amazon Web Services account
   + Initialize and shutdown the SDK in your app or service
   + Create a CMake project to build your app or service

1. Create and run a sample app. For sample apps that use the Amazon SDK for C\+\+, see [Amazon SDK for C\+\+ Code Examples](https://docs.amazonaws.cn/sdk-for-cpp/v1/developer-guide/programming-services.html).

**Documentation for the Amazon IoT Core services that the Amazon SDK for C\+\+ supports**
+ [Amazon::IoTClient" reference documentation](https://sdk.amazonaws.com/cpp/api/LATEST/root/html/index.html)
+ [Aws::IoTDataPlane::IoTDataPlaneClient reference documentation](http://sdk.amazonaws.com/cpp/api/LATEST/class_aws_1_1_io_t_data_plane_1_1_io_t_data_plane_client.html)
+ [Aws::IoTJobsDataPlane::IoTJobsDataPlaneClient reference documentation](http://sdk.amazonaws.com/cpp/api/LATEST/class_aws_1_1_io_t_jobs_data_plane_1_1_io_t_jobs_data_plane_client.html)
+ [Aws::IoTSecureTunneling::IoTSecureTunnelingClient reference documentation](http://sdk.amazonaws.com/cpp/api/LATEST/class_aws_1_1_io_t_secure_tunneling_1_1_io_t_secure_tunneling_client.html)

------
#### [ Go ]

**To install the [Amazon SDK for Go](https://aws.amazon.com/sdk-for-go/) and use it to connect to Amazon IoT:**

1. Follow the instructions in [Getting Started with the Amazon SDK for Go](https://docs.amazonaws.cn/sdk-for-go/v1/developer-guide/setting-up.html)

   These instructions describe how to:
   + Install the Amazon SDK for Go
   + Get access keys for the SDK to access your Amazon Web Services account
   + Import packages into the source code of our apps or services

1. Create and run a sample app. For sample apps that use the Amazon SDK for Go, see [Amazon SDK for Go Code Examples](https://docs.amazonaws.cn/sdk-for-go/v1/developer-guide/common-examples.html).

**Documentation for the Amazon IoT Core services that the Amazon SDK for Go supports**
+ [IoT reference documentation](https://docs.amazonaws.cn/sdk-for-go/api/service/iot/)
+ [IoTDataPlane reference documentation](https://docs.amazonaws.cn/sdk-for-go/api/service/iotdataplane/)
+ [IoTJobsDataPlane reference documentation](https://docs.amazonaws.cn/sdk-for-go/api/service/iotjobsdataplane/)
+ [IoTSecureTunneling reference documentation](https://docs.amazonaws.cn/sdk-for-go/api/service/iotsecuretunneling/)

------
#### [ Java ]

**To install the [Amazon SDK for Java](https://aws.amazon.com/sdk-for-java/) and use it to connect to Amazon IoT:**

1. Follow the instructions in [Getting Started with Amazon SDK for Java 2.x](https://docs.amazonaws.cn/sdk-for-java/v2/developer-guide/getting-started.html)

   These instructions describe how to:
   + Sign up for Amazon and Create an IAM User
   + Download the SDK 
   + Set up Amazon Credentials and Region 
   + Use the SDK with Apache Maven 
   + Use the SDK with Gradle 

1. Create and run a sample app using one of the [Amazon SDK for Java 2.x Code Examples](https://docs.amazonaws.cn/sdk-for-java/v2/developer-guide/advanced-topics.html).

1. Review the [SDK API reference documentation](https://sdk.amazonaws.com/java/api/latest/)

**Documentation for the Amazon IoT Core services that the Amazon SDK for Java supports**
+ [IotClient reference documentation](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iot/IotClient.html)
+ [IotDataPlaneClient reference documentation](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iotdataplane/IotDataPlaneClient.html)
+ [IotJobsDataPlaneClient reference documentation](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iotjobsdataplane/IotJobsDataPlaneClient.html)
+ [IoTSecureTunnelingClient reference documentation](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iotsecuretunneling/IoTSecureTunnelingClient.html)

------
#### [ JavaScript ]

**To install the Amazon SDK for JavaScript and use it to connect to Amazon IoT:**

1. Follow the instructions in [Setting Up the Amazon SDK for JavaScript](https://docs.amazonaws.cn/sdk-for-javascript/v2/developer-guide/setting-up.html). These instructions apply to using the Amazon SDK for JavaScript in the browser and with Node.JS. Make sure you follow the directions that apply to your installation. 

   These instructions describe how to:
   + Check for the prerequisites
   + Install the SDK for JavaScript
   + Load the SDK for JavaScript

1. Create and run a sample app to get started with the SDK as the getting started option for your environment describes.
   + Get started with the [Amazon SDK for JavaScript in the Browser](https://docs.amazonaws.cn/sdk-for-javascript/v2/developer-guide/getting-started-browser.html), or
   + Get started with the [Amazon SDK for JavaScript in Node.js](https://docs.amazonaws.cn/sdk-for-javascript/v2/developer-guide/getting-started-nodejs.html)

**Documentation for the Amazon IoT Core services that the Amazon SDK for JavaScript supports**
+ [https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/Iot.html](https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/Iot.html)
+ [https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/IotData.html](https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/IotData.html)
+ [https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/IoTJobsDataPlane.html](https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/IoTJobsDataPlane.html)
+ [https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/IoTSecureTunneling.html](https://docs.amazonaws.cn/AWSJavaScriptSDK/latest/AWS/IoTSecureTunneling.html)

------
#### [ .NET ]

**To install the [Amazon SDK for .NET](https://aws.amazon.com/sdk-for-net/) and use it to connect to Amazon IoT:**

1. Follow the instructions in [Setting up your Amazon SDK for .NET environment](https://docs.amazonaws.cn/sdk-for-net/latest/developer-guide/net-dg-setup.html)

1. Follow the instructions in [Setting up your Amazon SDK for .NET project](https://docs.amazonaws.cn/sdk-for-net/latest/developer-guide/net-dg-config.html)

   These instructions describe how to:
   + Start a new project
   + Obtain and configure Amazon credentials
   + Install Amazon SDK packages

1. Create and run one of the sample programs in [Working with Amazon services in the Amazon SDK for .NET](https://docs.amazonaws.cn/sdk-for-net/latest/developer-guide/tutorials-examples.html)

1. Review the [SDK API reference documentation](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/index.html)

**Documentation for the Amazon IoT Core services that the Amazon SDK for .NET supports**
+ [Amazon.IoT.Model reference documentation](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/items/IoT/NIoTModel.html)
+ [Amazon.IotData.Model reference documentation](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/items/IotData/NIotDataModel.html)
+ [Amazon.IoTJobsDataPlane.Model reference documentation](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/items/IoTJobsDataPlane/NIoTJobsDataPlaneModel.html)
+ [Amazon.IoTSecureTunneling.Model reference documentation](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/items/IoTSecureTunneling/NIoTSecureTunnelingModel.html)

------
#### [ PHP ]

**To install the [Amazon SDK for PHP](https://aws.amazon.com/sdk-for-php/) and use it to connect to Amazon IoT:**

1. Follow the instructions in [Getting Started with the Amazon SDK for PHP Version 3](https://docs.amazonaws.cn/sdk-for-php/v3/developer-guide/getting-started_index.html)

   These instructions describe how to:
   + Check for the prerequisites
   + Install the SDK
   + Apply the SDK to a PHP script

1. Create and run a sample app using one of the [Amazon SDK for PHP Version 3 Code Examples](https://docs.amazonaws.cn/sdk-for-php/v3/developer-guide/examples_index.html)

**Documentation for the Amazon IoT Core services that the Amazon SDK for PHP supports**
+ [IoTClient reference documentation](https://docs.amazonaws.cn/aws-sdk-php/v3/api/class-Aws.Iot.IotClient.html)
+ [IoTDataPlaneClient reference documentation](https://docs.amazonaws.cn/aws-sdk-php/v3/api/class-Aws.IotDataPlane.IotDataPlaneClient.html)
+ [IoTJobsDataPlaneClient reference documentation](https://docs.amazonaws.cn/aws-sdk-php/v3/api/class-Aws.IoTJobsDataPlane.IoTJobsDataPlaneClient.html)
+ [IoTSecureTunnelingClient reference documentation](https://docs.amazonaws.cn/aws-sdk-php/v3/api/class-Aws.IoTSecureTunneling.IoTSecureTunnelingClient.html)

------
#### [ Python ]

**To install the [Amazon SDK for Python (Boto3)](https://aws.amazon.com/sdk-for-python/) and use it to connect to Amazon IoT:**

1. Follow the instructions in the [Amazon SDK for Python (Boto3) Quickstart](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html)

   These instructions describe how to:
   + Install the SDK
   + Configure the SDK
   + Use the SDK in your code

1. Create and run a sample program that uses the Amazon SDK for Python (Boto3)

   This program displays the account's currently configured logging options. After you install the SDK and configure it for your account, you should be able to run this program.

   ```
   import boto3
   import json
   
   # initialize client
   iot = boto3.client('iot')
   
   # get current logging levels, format them as JSON, and write them to stdout
   response = iot.get_v2_logging_options()
   print(json.dumps(response, indent=4))
   ```

    For more information about the function used in this example, see [Configure Amazon IoT logging](configure-logging.md).

**Documentation for the Amazon IoT Core services that the Amazon SDK for Python (Boto3) supports**
+ [IoT reference documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot.html)
+ [IoTDataPlane reference documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot-data.html)
+ [IoTJobsDataPlane reference documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot-jobs-data.html)
+ [IoTSecureTunneling reference documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iotsecuretunneling.html)

------
#### [ Ruby ]

**To install the [Amazon SDK for Ruby](https://aws.amazon.com/sdk-for-ruby/) and use it to connect to Amazon IoT:**
+ Follow the instructions in [Getting Started with the Amazon SDK for Ruby](https://docs.amazonaws.cn/sdk-for-ruby/v3/developer-guide/getting-started.html)

  These instructions describe how to:
  + Install the SDK
  + Configure the SDK
+ Create and run the [Hello World Tutorial](https://docs.amazonaws.cn/sdk-for-ruby/v3/developer-guide/hello.html)

**Documentation for the Amazon IoT Core services that the Amazon SDK for Ruby supports**
+ [Aws::IoT::Client reference documentation](https://docs.amazonaws.cn/sdk-for-ruby/v3/api/Aws/IoT/Client.html)
+ [Aws::IoTDataPlane::Client reference documentation](https://docs.amazonaws.cn/sdk-for-ruby/v3/api/Aws/IoTDataPlane/Client.html)
+ [Aws::IoTJobsDataPlane::Client reference documentation](https://docs.amazonaws.cn/sdk-for-ruby/v3/api/Aws/IoTJobsDataPlane/Client.html)
+ [Aws::IoTSecureTunneling::Client reference documentation](https://docs.amazonaws.cn/sdk-for-ruby/v3/api/Aws/IoTSecureTunneling/Client.html)

------

## Amazon Mobile SDKs
<a name="iot-connect-mobile-sdks"></a>

The Amazon Mobile SDKs provide mobile app developers platform-specific support for the APIs of the Amazon IoT Core services, IoT device communication using MQTT, and the APIs of other Amazon services. 

------
#### [ Android ]

**Amazon Mobile SDK for Android**

The Amazon Mobile SDK for Android contains a library, samples, and documentation for developers to build connected mobile applications using Amazon. This SDK also includes support for MQTT device communications and calling the APIs of the Amazon IoT Core services. For more information, see the following:
+ [Amazon Mobile SDK for Android on GitHub](https://github.com/aws/aws-sdk-android)
+ [Amazon Mobile SDK for Android Readme](https://github.com/aws-amplify/aws-sdk-android/blob/main/README.md#aws-sdk-for-android)
+ [Amazon Mobile SDK for Android Samples](https://github.com/awslabs/aws-sdk-android-samples#aws-sdk-for-android-samples)
+ [Amazon SDK for Android API reference](https://aws-amplify.github.io/aws-sdk-android/docs/reference/)
+ [AWSIoTClient Class reference documentation](https://aws-amplify.github.io/aws-sdk-android/docs/reference/com/amazonaws/services/iot/AWSIotClient.html)

------
#### [ iOS ]

**Amazon Mobile SDK for iOS**

The Amazon Mobile SDK for iOS is an open-source software development kit, distributed under an Apache Open Source license. The SDK for iOS provides a library, code samples, and documentation to help developers build connected mobile applications using Amazon. This SDK also includes support for MQTT device communications and calling the APIs of the Amazon IoT Core services. For more information, see the following:
+ [Amazon Mobile SDK for iOS on GitHub](https://github.com/aws/aws-sdk-ios)
+ [Amazon SDK for iOS Readme](https://github.com/aws-amplify/aws-sdk-ios/blob/main/README.md#aws-sdk-for-ios)
+ [Amazon SDK for iOS Samples](https://github.com/awslabs/aws-sdk-ios-samples#the-aws-sdk-for-ios-samples)
+ [Amazon IoT Class reference docs in the Amazon SDK for iOS](https://aws-amplify.github.io/aws-sdk-ios/docs/reference/AWSIoT/index.html)

------

## REST APIs of the Amazon IoT Core services
<a name="iot-connect-rest"></a>

The REST APIs of the Amazon IoT Core services can be called directly by using HTTP requests.
+ 

**Endpoint URL**  
The service endpoints that expose the REST APIs of the Amazon IoT Core services vary by Region and are listed in [Amazon IoT Core Endpoints and Quotas](https://docs.amazonaws.cn//general/latest/gr/iot-core.html). You must use the endpoint for the Region that has the Amazon IoT resources that you want to access, because Amazon IoT resources are Region specific.
+ 

**Authentication**  
The REST APIs of the Amazon IoT Core services use Amazon IAM credentials for authentication. For more information, see [Signing Amazon API requests](https://docs.amazonaws.cn//general/latest/gr/signing_aws_api_requests.html) in the Amazon General Reference.
+ 

**API reference**  
For information about the specific functions provided by the REST APIs of the Amazon IoT Core services, see:
  + [API reference for IoT](https://docs.amazonaws.cn//iot/latest/apireference/API_Operations_AWS_IoT.html).
  + [API reference for IoT data](https://docs.amazonaws.cn//iot/latest/apireference/API_Operations_AWS_IoT_Data_Plane.html).
  + [API reference for IoT jobs data](https://docs.amazonaws.cn//iot/latest/apireference/API_Operations_AWS_IoT_Jobs_Data_Plane.html).
  + [API reference for IoT secure tunneling](https://docs.amazonaws.cn//iot/latest/apireference/API_Operations_AWS_IoT_Secure_Tunneling.html).