调用该接口获取网关信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 | 
|---|---|---|---|---|
| Action | String | 是 | GetGateway | 
                               系统规定参数。取值:GetGateway。  | 
                           
                        
| IotInstanceId | String | 否 | iot-060a09b1 | 
                               实例ID。 您可在物联网平台控制台的实例概览页面,查看当前实例的ID。若有ID值,必须传入该ID值,否则调用会失败。 说明 如果公共实例没有ID值,请参见如何获取实例ID。
                                  
                               | 
                           
                        
| GwEui | String | 是 | 0000000000000000 | 
                               网关唯一标识。  | 
                           
                        
返回数据
| 名称 | 类型 | 示例值 | 描述 | 
|---|---|---|---|
| Success | Boolean | true | 
                               是否成功。  | 
                           
                        
| RequestId | String | 89EF6CAA-958F-F32C-BE45-FE003C6DE097 | 
                               请求ID。  | 
                           
                        
| Data | Object | 
                               网关信息。  | 
                           
                        |
| ChargeStatus | String | NORMAL | 
                               网关欠费状态。 
  | 
                           
                        
| ClassBSupported | Boolean | true | 
                               该网关是否支持Class B模式。  | 
                           
                        
| FreqBandPlanGroupId | Long | 123 | 
                               网关频段ID。  | 
                           
                        
| District | String | 某某区 | 
                               网关所在城区名称。  | 
                           
                        
| GisCoordinateSystem | String | GCJ_02 | 
                               网关经纬度所采用的坐标系统,可取值:WGS_84, GCJ_02。  | 
                           
                        
| City | String | 某某市 | 
                               网关所在城市名称。  | 
                           
                        
| TimeCorrectable | Boolean | true | 
                               该网关是否可以作为时间校准网关。  | 
                           
                        
| OnlineState | String | ONLINE | 
                               网关的在线、离线状态。 
  | 
                           
                        
| AuthTypes | String | STANDARD | 
                               网关合约类型。 
  | 
                           
                        
| OnlineStateChangedMillis | Long | 1514736000000 | 
                               最近一次在线、离线状态的变更时间。 格式为UNIX时间戳,以毫秒为单位。  | 
                           
                        
| CommunicationMode | String | HALF_DUPLEX | 
                               网关通信模式。可取值为: 
  | 
                           
                        
| Description | String | 网关描述 | 
                               自定义网关描述。  | 
                           
                        
| Enabled | Boolean | true | 
                               该网关是否处于启用状态。 
  | 
                           
                        
| ClassBWorking | Boolean | true | 
                               该网关是否正工作在Class B模式下。  | 
                           
                        
| Address | String | 详细地址 | 
                               网关所在详细地址。  | 
                           
                        
| Longitude | Float | 123.45678 | 
                               网关经度。  | 
                           
                        
| EmbeddedNsId | String | 123 | 
                               Hybrid网关id。  | 
                           
                        
| Latitude | Float | 23.45678 | 
                               网关纬度。  | 
                           
                        
| Name | String | 网关名称 | 
                               自定义网关名称。  | 
                           
                        
| GwEui | String | 0000000000000000 | 
                               网关唯一标识。  | 
                           
                        
| AddressCode | Long | 123 | 
                               网关所在地区ID,由  | 
                           
                        
示例
请求示例
http(s)://linkwan.cn-shanghai.aliyuncs.com/?Action=GetGateway
&GwEui=0000000000000000
&RegionId=cn-shanghai
&<公共请求参数>
                  正常返回示例
XML格式
                  
HTTP/1.1 200 OK
Content-Type:application/xml
<GetGatewayResponse>
      <Data>
            <City>某某市</City>
            <Name>网关名称</Name>
            <District>某某区</District>
            <OnlineState>ONLINE</OnlineState>
            <TimeCorrectable>true</TimeCorrectable>
            <Enabled>true</Enabled>
            <Longitude>123.45678</Longitude>
            <Latitude>23.45678</Latitude>
            <OnlineStateChangedMillis>1514736000000</OnlineStateChangedMillis>
            <ClassBSupported>true</ClassBSupported>
            <Address>详细地址</Address>
            <GwEui>0000000000000000</GwEui>
            <CommunicateMode>HALF_DUPLEX</CommunicateMode>
            <ClassBWorking>true</ClassBWorking>
            <FreqBandPlanGroupId>123</FreqBandPlanGroupId>
            <AddressCode>123</AddressCode>
            <GisCoordinateSystem>GCJ-02</GisCoordinateSystem>
            <Description>网关描述</Description>
      </Data>
      <RequestId>89EF6CAA-958F-F32C-BE45-FE003C6DE097</RequestId>
      <Success>true</Success>
</GetGatewayResponse>
                  JSON格式
                  
HTTP/1.1 200 OK
Content-Type:application/json
{
  "Data" : {
    "TimeCorrectable" : true,
    "Enabled" : true,
    "Description" : "网关描述",
    "OnlineStateChangedMillis" : 1514736000000,
    "GisCoordinateSystem" : "GCJ-02",
    "AddressCode" : 123,
    "ClassBSupported" : true,
    "City" : "某某市",
    "Name" : "网关名称",
    "FreqBandPlanGroupId" : 123,
    "District" : "某某区",
    "ClassBWorking" : true,
    "Address" : "详细地址",
    "Latitude" : 23.45678,
    "Longitude" : 123.45678,
    "OnlineState" : "ONLINE",
    "CommunicateMode" : "HALF_DUPLEX",
    "GwEui" : "0000000000000000"
  },
  "RequestId" : "89EF6CAA-958F-F32C-BE45-FE003C6DE097",
  "Success" : true
}
                  错误码
| HttpCode | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | ForbiddenByRam | User not authorized to operate on the specified resource, or this API does not support RAM. | 用户没有执行该操作所需要的RAM权限。 | 
| 400 | ForbiddenByRiskControl | This operation cannot be performed because of security risks. | 存在安全风险,无法执行该操作 | 
| 400 | NonExistent | The specified resource does not exist. | 要操作的资源不存在。 | 
| 400 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误。 | 
| 400 | NotResourceOwner | You are not authorized to use this resource. | 无权访问此资源 | 
访问错误中心查看更多错误码。