Skip to content

登录与内部服务 API ​

本页列出当前版本的完整方法及字段。方法通过 gRPC / gRPC-Web 调用;REST 注解不表示已部署 REST Gateway。

“必填:按业务校验”表示 proto3 未声明 required,不代表留空一定可用。UUID、EUI、权限、资源存在性与字段组合由服务端校验。嵌套结构详见页末消息结构。

调用方式、鉴权与错误处理

InternalService ​

Login ​

接口名称: api.InternalService/Login

功能: 登录并获取 JWT。Log in a user

请求: api.LoginRequest;返回: api.LoginResponse(单次响应)。

请求参数 ​

名称类型必填说明
emailstring按业务校验登录身份 / 邮箱。 Email of the user.
passwordstring按业务校验密码。 Password of the user.

返回值 ​

名称类型必填说明
jwtstring按业务校验登录令牌。 The JWT tag to be used to access chirpstack-application-server interfaces.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

Profile ​

接口名称: api.InternalService/Profile

功能: 查询当前用户资料。Get the current user's profile

请求: google.protobuf.Empty;返回: api.ProfileResponse(单次响应)。

请求参数 ​

无字段。

返回值 ​

名称类型必填说明
userapi.User按业务校验用户对象。 User object.
tenantsrepeated api.UserTenantLink按业务校验关联租户列表。 Tenants to which the user is associated.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

GlobalSearch ​

接口名称: api.InternalService/GlobalSearch

功能: GlobalSearch。Perform a global search.

请求: api.GlobalSearchRequest;返回: api.GlobalSearchResponse(单次响应)。

请求参数 ​

名称类型必填说明
searchstring按业务校验搜索关键字。 Search query.
limitint64按业务校验本次最多返回条数。 Max number of results to return. If not set, it will be treated as 0, and the response will only return the total_count.
offsetint64按业务校验分页起始偏移。 Offset offset of the result-set (for pagination).

返回值 ​

名称类型必填说明
resultrepeated api.GlobalSearchResult按业务校验结果列表或结果内容。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

CreateApiKey ​

接口名称: api.InternalService/CreateApiKey

功能: 创建 ApiKey。CreateApiKey creates the given API key.

请求: api.CreateApiKeyRequest;返回: api.CreateApiKeyResponse(单次响应)。

请求参数 ​

名称类型必填说明
api_keyapi.ApiKey按业务校验接口密钥属性。 The API key to create.

返回值 ​

名称类型必填说明
idstring按业务校验资源 ID。 API key ID.
tokenstring按业务校验API 调用令牌。 API token for authentication API requests.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

DeleteApiKey ​

接口名称: api.InternalService/DeleteApiKey

功能: 删除 ApiKey。DeleteApiKey deletes the API key.

请求: api.DeleteApiKeyRequest;返回: google.protobuf.Empty(单次响应)。

请求参数 ​

名称类型必填说明
idstring按业务校验资源 ID。 API key ID.

返回值 ​

无字段。

操作影响

此方法会删除、清空或重置对应资源/状态。调用前核对目标 ID;请勿通过重试重复执行有副作用的操作。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

ListApiKeys ​

接口名称: api.InternalService/ListApiKeys

功能: 列出 ApiKeys。ListApiKeys lists the available API keys.

请求: api.ListApiKeysRequest;返回: api.ListApiKeysResponse(单次响应)。

请求参数 ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 Max number of items to return. If not set, it will be treated as 0, and the response will only return the total_count.
offsetuint32按业务校验分页起始偏移。 Offset in the result-set (for pagination).
is_adminbool按业务校验平台或当前资源范围管理员标志。 Return only admin keys.
tenant_idstring按业务校验租户 UUID。 Filter on tenant ID.

返回值 ​

名称类型必填说明
total_countuint32按业务校验符合条件的总条数。 Total number of API keys.
resultrepeated api.ApiKey按业务校验结果列表或结果内容。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

Settings ​

接口名称: api.InternalService/Settings

功能: Settings。Get the global settings.

请求: google.protobuf.Empty;返回: api.SettingsResponse(单次响应)。

请求参数 ​

无字段。

返回值 ​

名称类型必填说明
openid_connectapi.OpenIdConnect按业务校验OpenId Connect settings.
oauth2api.OAuth2按业务校验OAuth2 settings.
tileserver_urlstring按业务校验Tileserver URL.
map_attributionstring按业务校验Map attribution.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

OpenIdConnectLogin ​

接口名称: api.InternalService/OpenIdConnectLogin

功能: OpenIdConnectLogin。OpenId Connect login.

请求: api.OpenIdConnectLoginRequest;返回: api.OpenIdConnectLoginResponse(单次响应)。

请求参数 ​

名称类型必填说明
codestring按业务校验代码。 OpenId Connect callback code.
statestring按业务校验OpenId Connect callback state.

返回值 ​

名称类型必填说明
tokenstring按业务校验API 调用令牌。 Token to use for authentication.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

OAuth2Login ​

接口名称: api.InternalService/OAuth2Login

功能: OAuth2Login。OAuth2 login.

请求: api.OAuth2LoginRequest;返回: api.OAuth2LoginResponse(单次响应)。

请求参数 ​

名称类型必填说明
codestring按业务校验代码。 OAuth2 callback code.
statestring按业务校验OAuth2 callback state.

返回值 ​

名称类型必填说明
tokenstring按业务校验API 调用令牌。 Token to use for authentication.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

GetDevicesSummary ​

接口名称: api.InternalService/GetDevicesSummary

功能: 查询 DevicesSummary。GetDevicesSummary returns an aggregated summary of the devices.

请求: api.GetDevicesSummaryRequest;返回: api.GetDevicesSummaryResponse(单次响应)。

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).

返回值 ​

名称类型必填说明
active_countuint32按业务校验Active count.
inactive_countuint32按业务校验Inactive count.
dr_countmap<uint32, uint32>按业务校验per data-rate count. Devices that have never been seen are excluded.
never_seen_countuint32按业务校验Never seen count.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

GetGatewaysSummary ​

接口名称: api.InternalService/GetGatewaysSummary

功能: 查询 GatewaysSummary。GetGatewaysSummary returns an aggregated summary of the gateways.

请求: api.GetGatewaysSummaryRequest;返回: api.GetGatewaysSummaryResponse(单次响应)。

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).

返回值 ​

名称类型必填说明
online_countuint32按业务校验Online count.
offline_countuint32按业务校验Offline count.
never_seen_countuint32按业务校验Never seen count.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

StreamGatewayFrames ​

接口名称: api.InternalService/StreamGatewayFrames

功能: 持续订阅网关无线帧。Stream frame for the given Gateway ID.

请求: api.StreamGatewayFramesRequest;返回: api.LogItem(服务端流:持续返回多条消息)。

请求参数 ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

返回值 ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
timegoogle.protobuf.Timestamp按业务校验时间。 Timestamp.
descriptionstring按业务校验描述。 Message.
bodystring按业务校验Body.
propertiesmap<string, string>按业务校验Properties.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

StreamDeviceFrames ​

接口名称: api.InternalService/StreamDeviceFrames

功能: 持续订阅终端无线帧。Stream frames for the given Device EUI.

请求: api.StreamDeviceFramesRequest;返回: api.LogItem(服务端流:持续返回多条消息)。

请求参数 ​

名称类型必填说明
dev_euistring按业务校验终端完整 DevEUI。 Device EUI.

返回值 ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
timegoogle.protobuf.Timestamp按业务校验时间。 Timestamp.
descriptionstring按业务校验描述。 Message.
bodystring按业务校验Body.
propertiesmap<string, string>按业务校验Properties.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

StreamDeviceEvents ​

接口名称: api.InternalService/StreamDeviceEvents

功能: 持续订阅终端应用事件。Stream events for the given Device EUI.

请求: api.StreamDeviceEventsRequest;返回: api.LogItem(服务端流:持续返回多条消息)。

请求参数 ​

名称类型必填说明
dev_euistring按业务校验终端完整 DevEUI。 Device EUI.

返回值 ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
timegoogle.protobuf.Timestamp按业务校验时间。 Timestamp.
descriptionstring按业务校验描述。 Message.
bodystring按业务校验Body.
propertiesmap<string, string>按业务校验Properties.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

StreamRuntimeStatus ​

接口名称: api.InternalService/StreamRuntimeStatus

功能: 持续订阅运行状态变化。Stream runtime status changes for devices and gateways in a tenant.

请求: api.StreamRuntimeStatusRequest;返回: api.RuntimeStatusEvent(服务端流:持续返回多条消息)。

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
application_idstring按业务校验应用 UUID。 Optional application ID filter for devices.
include_devicesbool按业务校验Include device status events.
include_gatewaysbool按业务校验Include gateway status events.

返回值 ​

名称类型必填说明
resource_typestring按业务校验Resource type: device or gateway.
idstring按业务校验资源 ID。 Device EUI or Gateway ID.
tenant_idstring按业务校验租户 UUID。 Tenant ID.
application_idstring按业务校验应用 UUID。 Application ID, only set for devices.
statestring按业务校验State: online, offline, never-seen, or disabled.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen timestamp.
next_offline_atgoogle.protobuf.Timestamp按业务校验Timestamp at which the resource should be considered offline.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

ListRegions ​

接口名称: api.InternalService/ListRegions

功能: 列出 Regions。ListRegions lists the available (configured) regions.

请求: google.protobuf.Empty;返回: api.ListRegionsResponse(单次响应)。

请求参数 ​

无字段。

返回值 ​

名称类型必填说明
regionsrepeated api.RegionListItem按业务校验Configured regions.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

GetRegion ​

接口名称: api.InternalService/GetRegion

功能: 查询 Region。GetRegion returns the region details for the given region.

请求: api.GetRegionRequest;返回: api.GetRegionResponse(单次响应)。

请求参数 ​

名称类型必填说明
idstring按业务校验资源 ID。 Region ID.

返回值 ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
regioncommon.Region {EU868=0, US915=2, CN779=3, EU433=4, AU915=5, CN470=6, AS923=7, AS923_2=12, AS923_3=13, AS923_4=14, KR920=8, IN865=9, RU864=10, ISM2400=11}按业务校验区域枚举。 Region.
user_infostring按业务校验User information.
uplink_channelsrepeated api.RegionChannel按业务校验Uplink channels.
rx1_delayuint32按业务校验RX1 delay.
rx1_dr_offsetuint32按业务校验RX1 data-rate offset.
rx2_druint32按业务校验RX2 DR.
rx2_frequencyuint32按业务校验RX2 frequency.
class_b_ping_slot_druint32按业务校验Class-B ping-slot DR.
class_b_ping_slot_frequencyuint32按业务校验Class-B ping-slot frequency.
descriptionstring按业务校验描述。 Region description.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

GetVersion ​

接口名称: api.InternalService/GetVersion

功能: 查询 Version。GetVersion returns the ChirpStack version.

请求: google.protobuf.Empty;返回: api.GetVersionResponse(单次响应)。

请求参数 ​

无字段。

返回值 ​

名称类型必填说明
versionstring按业务校验version

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

嵌套消息结构 ​

api.ApiKey ​

名称类型必填说明
idstring按业务校验资源 ID。 API key ID. This value will be automatically generated on create.
namestring按业务校验名称。 Name.
is_adminbool按业务校验平台或当前资源范围管理员标志。 Is global admin key.
tenant_idstring按业务校验租户 UUID。 Tenant ID. In case the API key is intended to manage resources under a single tenant.
is_read_onlybool按业务校验是否只读。 Is read-only.

api.CreateApiKeyRequest ​

名称类型必填说明
api_keyapi.ApiKey按业务校验接口密钥属性。 The API key to create.

api.CreateApiKeyResponse ​

名称类型必填说明
idstring按业务校验资源 ID。 API key ID.
tokenstring按业务校验API 调用令牌。 API token for authentication API requests.

api.DeleteApiKeyRequest ​

名称类型必填说明
idstring按业务校验资源 ID。 API key ID.

api.GetDevicesSummaryRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).

api.GetDevicesSummaryResponse ​

名称类型必填说明
active_countuint32按业务校验Active count.
inactive_countuint32按业务校验Inactive count.
dr_countmap<uint32, uint32>按业务校验per data-rate count. Devices that have never been seen are excluded.
never_seen_countuint32按业务校验Never seen count.

api.GetDevicesSummaryResponse.DrCountEntry ​

名称类型必填说明
keyuint32按业务校验消息定义未补充字段说明。
valueuint32按业务校验消息定义未补充字段说明。

api.GetGatewaysSummaryRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).

api.GetGatewaysSummaryResponse ​

名称类型必填说明
online_countuint32按业务校验Online count.
offline_countuint32按业务校验Offline count.
never_seen_countuint32按业务校验Never seen count.

api.GetRegionRequest ​

名称类型必填说明
idstring按业务校验资源 ID。 Region ID.

api.GetRegionResponse ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
regioncommon.Region {EU868=0, US915=2, CN779=3, EU433=4, AU915=5, CN470=6, AS923=7, AS923_2=12, AS923_3=13, AS923_4=14, KR920=8, IN865=9, RU864=10, ISM2400=11}按业务校验区域枚举。 Region.
user_infostring按业务校验User information.
uplink_channelsrepeated api.RegionChannel按业务校验Uplink channels.
rx1_delayuint32按业务校验RX1 delay.
rx1_dr_offsetuint32按业务校验RX1 data-rate offset.
rx2_druint32按业务校验RX2 DR.
rx2_frequencyuint32按业务校验RX2 frequency.
class_b_ping_slot_druint32按业务校验Class-B ping-slot DR.
class_b_ping_slot_frequencyuint32按业务校验Class-B ping-slot frequency.
descriptionstring按业务校验描述。 Region description.

api.GetVersionResponse ​

名称类型必填说明
versionstring按业务校验version

api.GlobalSearchRequest ​

名称类型必填说明
searchstring按业务校验搜索关键字。 Search query.
limitint64按业务校验本次最多返回条数。 Max number of results to return. If not set, it will be treated as 0, and the response will only return the total_count.
offsetint64按业务校验分页起始偏移。 Offset offset of the result-set (for pagination).

api.GlobalSearchResponse ​

名称类型必填说明
resultrepeated api.GlobalSearchResult按业务校验结果列表或结果内容。

api.GlobalSearchResult ​

名称类型必填说明
kindstring按业务校验Record kind.
scorefloat按业务校验Search score.
tenant_idstring按业务校验租户 UUID。 Organization id.
tenant_namestring按业务校验Organization name.
application_idstring按业务校验应用 UUID。 Application id.
application_namestring按业务校验Application name.
device_dev_euistring按业务校验Device DevEUI (hex encoded).
device_namestring按业务校验Device name.
gateway_idstring按业务校验网关 EUI。 Gateway MAC (hex encoded).
gateway_namestring按业务校验Gateway name.

api.ListApiKeysRequest ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 Max number of items to return. If not set, it will be treated as 0, and the response will only return the total_count.
offsetuint32按业务校验分页起始偏移。 Offset in the result-set (for pagination).
is_adminbool按业务校验平台或当前资源范围管理员标志。 Return only admin keys.
tenant_idstring按业务校验租户 UUID。 Filter on tenant ID.

api.ListApiKeysResponse ​

名称类型必填说明
total_countuint32按业务校验符合条件的总条数。 Total number of API keys.
resultrepeated api.ApiKey按业务校验结果列表或结果内容。

api.ListRegionsResponse ​

名称类型必填说明
regionsrepeated api.RegionListItem按业务校验Configured regions.

api.LogItem ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
timegoogle.protobuf.Timestamp按业务校验时间。 Timestamp.
descriptionstring按业务校验描述。 Message.
bodystring按业务校验Body.
propertiesmap<string, string>按业务校验Properties.

api.LogItem.PropertiesEntry ​

名称类型必填说明
keystring按业务校验消息定义未补充字段说明。
valuestring按业务校验消息定义未补充字段说明。

api.LoginRequest ​

名称类型必填说明
emailstring按业务校验登录身份 / 邮箱。 Email of the user.
passwordstring按业务校验密码。 Password of the user.

api.LoginResponse ​

名称类型必填说明
jwtstring按业务校验登录令牌。 The JWT tag to be used to access chirpstack-application-server interfaces.

api.OAuth2 ​

名称类型必填说明
enabledbool按业务校验OAuth2 is enabled.
login_urlstring按业务校验Login url.
login_labelstring按业务校验Login label.
logout_urlstring按业务校验Logout url.
login_redirectbool按业务校验Login redirect.

api.OAuth2LoginRequest ​

名称类型必填说明
codestring按业务校验代码。 OAuth2 callback code.
statestring按业务校验OAuth2 callback state.

api.OAuth2LoginResponse ​

名称类型必填说明
tokenstring按业务校验API 调用令牌。 Token to use for authentication.

api.OpenIdConnect ​

名称类型必填说明
enabledbool按业务校验Enable OpenId Connect authentication.
login_urlstring按业务校验Login url.
login_labelstring按业务校验Login label.
logout_urlstring按业务校验Logout url.
login_redirectbool按业务校验Login redirect.

api.OpenIdConnectLoginRequest ​

名称类型必填说明
codestring按业务校验代码。 OpenId Connect callback code.
statestring按业务校验OpenId Connect callback state.

api.OpenIdConnectLoginResponse ​

名称类型必填说明
tokenstring按业务校验API 调用令牌。 Token to use for authentication.

api.ProfileResponse ​

名称类型必填说明
userapi.User按业务校验用户对象。 User object.
tenantsrepeated api.UserTenantLink按业务校验关联租户列表。 Tenants to which the user is associated.

api.RegionChannel ​

名称类型必填说明
frequencyuint32按业务校验频率。 Frequency (Hz).
data_ratesrepeated uint32按业务校验Data-rates.

api.RegionListItem ​

名称类型必填说明
idstring按业务校验资源 ID。 ID.
regioncommon.Region {EU868=0, US915=2, CN779=3, EU433=4, AU915=5, CN470=6, AS923=7, AS923_2=12, AS923_3=13, AS923_4=14, KR920=8, IN865=9, RU864=10, ISM2400=11}按业务校验区域枚举。 Region.
descriptionstring按业务校验描述。 Description.

api.RuntimeStatusEvent ​

名称类型必填说明
resource_typestring按业务校验Resource type: device or gateway.
idstring按业务校验资源 ID。 Device EUI or Gateway ID.
tenant_idstring按业务校验租户 UUID。 Tenant ID.
application_idstring按业务校验应用 UUID。 Application ID, only set for devices.
statestring按业务校验State: online, offline, never-seen, or disabled.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen timestamp.
next_offline_atgoogle.protobuf.Timestamp按业务校验Timestamp at which the resource should be considered offline.

api.SettingsResponse ​

名称类型必填说明
openid_connectapi.OpenIdConnect按业务校验OpenId Connect settings.
oauth2api.OAuth2按业务校验OAuth2 settings.
tileserver_urlstring按业务校验Tileserver URL.
map_attributionstring按业务校验Map attribution.

api.StreamDeviceEventsRequest ​

名称类型必填说明
dev_euistring按业务校验终端完整 DevEUI。 Device EUI.

api.StreamDeviceFramesRequest ​

名称类型必填说明
dev_euistring按业务校验终端完整 DevEUI。 Device EUI.

api.StreamGatewayFramesRequest ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

api.StreamRuntimeStatusRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
application_idstring按业务校验应用 UUID。 Optional application ID filter for devices.
include_devicesbool按业务校验Include device status events.
include_gatewaysbool按业务校验Include gateway status events.

api.User ​

名称类型必填说明
idstring按业务校验资源 ID。 User ID (UUID). Will be set automatically on create.
is_adminbool按业务校验平台或当前资源范围管理员标志。 Set to true to make the user a global administrator.
is_activebool按业务校验是否启用。 Set to false to disable the user.
emailstring按业务校验登录身份 / 邮箱。 E-mail of the user.
notestring按业务校验备注。 Optional note to store with the user.

Defines a tenant to which the user is associated.

名称类型必填说明
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
tenant_idstring按业务校验租户 UUID。 Tenant ID.
is_adminbool按业务校验平台或当前资源范围管理员标志。 User is admin within the context of this tenant. There is no need to set the is_device_admin and is_gateway_admin flags.
is_device_adminbool按业务校验User is able to modify device related resources (applications, device-profiles, devices, multicast-groups).
is_gateway_adminbool按业务校验User is able to modify gateways.

设备使用指南