If you use a device SDK, IoT Platform SDK, or Advanced Message Queuing Protocol (AMQP) SDK, you must specify the endpoint of the instance to which you want to connect your device. This topic describes how to obtain the endpoint of an instance.

Prerequisites

Before you view the endpoint of an IoT Platform instance, you must check the type of the instance and the region where the instance resides.
Instance Region Description Operation
Public instance of the old version China (Shanghai) and Japan (Tokyo)

On the Overview page of the IoT Platform console, no specific instance ID is displayed. In addition, you cannot click an instance to go to the Instance Details page.

Note You cannot create public instances of the new version in the Japan (Tokyo) region. All public instances in this region are of the old version.
In this case, you cannot view the development configurations of an instance in the IoT Platform console. This topic describes all endpoint information that is required to connect your device to IoT Platform. For more information, see the "View the endpoint of a public instance of the old version" section of this topic.
Singapore, Germany (Frankfurt), US (Silicon Valley), and US (Virginia)

If no Enterprise Edition instance is available, a public instance of the old version is used, and the Overview page is not displayed in the IoT Platform console.

Public instance of the new version China (Shanghai)

On the Overview page of the IoT Platform console, an instance ID is displayed. You can click an instance to go to the Instance Details page.

On the Instance Details page of the IoT Platform console, you can click View Development Configurations in the upper-right corner to open the Development Configurations panel that displays the endpoint information. For more information, see the "View the endpoint information of a public instance of the new version or an Enterprise Edition instance" section of this topic.
Enterprise Edition instance China (Shanghai) and Japan (Tokyo)
For information about IoT Platform instances, see Overview.

Background information

For information about how to use SDKs, see Download device SDKs, Download IoT Platform SDKs, and Connect an AMQP client to IoT Platform.

Usage notes

  • If you use AMQP-based server-side subscriptions or call IoT Platform API operations to connect devices to an IoT Platform instance over the Internet by using Message Queuing Telemetry Transport (MQTT), Constrained Application Protocol (CoAP), or HTTP, you must specify a public endpoint when you configure the devices.
  • If you use AMQP-based server-side subscriptions or call IoT Platform API operations to connect devices to an IoT Platform instance over a virtual private cloud (VPC) by using MQTT, you must specify a VPC endpoint when you configure the devices.
  • If you want to connect devices to an Enterprise Edition instance by using MQTT, you can bind a fixed IP address to the instance endpoint.

View the endpoint of a public instance of the old version

Communication type Endpoint format Port number
MQTT ${YourProductKey}.iot-as-mqtt.${YourRegionId}.aliyuncs.com 1883 or 443.

If MQTT over WebSocket is used, set this parameter to 443.

CoAP ${YourProductKey}.coap.cn-shanghai.link.aliyuncs.com
  • If Datagram Transport Layer Security (DTLS) is used, set this parameter to 5684.
  • If symmetric encryption is used, set this parameter to 5682.
HTTP https://iot-as-http.${YourRegionId}.aliyuncs.com Set this parameter to 443.
AMQP ${uid}.iot-amqp.${YourRegionId}.aliyuncs.com
  • If you use a Java, .NET, Python 2.7, Node.js, or Go client, the port number is 5671.
  • If you use a Python 3 or PHP client, the port number is 61614.
IoT Platform API request The syntax of API requests is http://Endpoint/?Action=**&Parameters. For more information, see Initiate API requests. N/A

Specify the following parameters based on your business requirements:

Parameter Description
${YourProductKey} The ProductKey of the product to which the device belongs. You can log on to the IoT Platform console and obtain the ProductKey on the Device Details page of the instance.
${YourRegionId} The ID of the region in which your device resides. For information about the format of region IDs, see Supported regions.
${uid} The ID of your Alibaba Cloud account. You can log on to the IoT Platform console, and move the pointer over the profile picture to view the account ID.

View the endpoint of a public instance of the new version or an Enterprise Edition instance

  1. Log on to the IoT Platform console. In the top navigation bar, select the region where the instance whose details you want to view resides.
  2. On the Overview page, click the alias or ID of the instance whose endpoint you want to view.
  3. On the Instance Details page of the instance, click View Development Configurations in the upper-right corner of the page.
    View development configurations
  4. On the Development Configurations panel, click the MQTT, CoAP, or HTTP tab to view the endpoint that is used by your device based on the protocol.
    Perform the following operations on each tab:
    • Click Copy to copy the instance endpoint.
    • Click the Help icon icon next to the endpoint to view the port number.
    Note For information about ports, see the "View the endpoint of a public instance of the old version" section of this topic.
    View configurations

Bind a fixed IP address to an endpoint

Fixed IP addresses prevent your Domain Name System (DNS) records from being updated when IoT Platform expands the list of IP addresses. If you use IoT cards and your carrier does not support endpoints, you can add your fixed IP address to the list of directional IP addresses of the carrier.

Note The IP address may change due to various reasons, such as the relocation of the data center of your carrier. If your device accesses a fixed IP address, you must send commands from IoT Platform or perform an over-the-air (OTA) update to synchronize the IP address to your device. Otherwise, your device cannot connect to IoT Platform.

We recommend that you use endpoints to connect your device to IoT Platform. This way, you are notified before an IP address is changed.

To bind fixed IP addresses to the endpoint that devices access over the Internet by using Message Queueing Telemetry Transport (MQTT), perform the following steps: You can allocate two fixed IP addresses to each MQTT device.

  1. In the upper-right corner of the Instance Details page of an instance, click View Development Configurations.
  2. In the Development Configurations panel, click Configure to the right of Fixed IP on the MQTT tab.
  3. In the dialog box that appears, click OK to obtain two fixed IP addresses.

If an MQTT device no longer require fixed IP addresses, click Unbind.