Subscribe to a device's network type. When it switches between 2G, 3G, 4G, and 5G, the operator sends a notification with its current type.
AIn 5G range
Notification5G
The device switches to 5G. The operator sends an event with the current network type.
BGo indoors and switch to 4G
Notification4G
The same event type includes the new network type, 4G.
CNotification limit reached
NotificationEnded
The number of notifications reaches the set limit. The subscription ends, and a notification gives the reason.
One event typeReceive a notification whenever the network type changes, with the current type.
Notification limitSet a maximum number of notifications. When it is reached, the subscription ends and a notification is sent.
Connected Network Type Subscriptions: How it works
- Create subscriptionThe service provider submits the notification URL and one event type. The device is identified by the authorization token or specified in the request. An expiration time and maximum number of notifications can be set.
- Wait for an eventOnce the subscription takes effect, the operator monitors the network type this device is connected to.
- Send notificationWhen an event occurs, the operator sends a notification to the specified URL. It also sends a notification when the subscription ends.
Connected Network Type Subscriptions: API spec
Spec name
Connected Network Type Subscriptions (CAMARA open-source spec)
API calls
POST /subscriptions to create; GET /subscriptions to list; GET/DELETE /subscriptions/{subscriptionId} to look up or deleteInput
protocol (HTTP), notification URL sink, types (one event type), device config.subscriptionDetail.device (identified by the token and omitted from the request when using a three-party authorization token)Events
network-type-changed; also subscription-started, subscription-updated, subscription-ended
Subscription settings
config.subscriptionExpireTime: expiration time; config.subscriptionMaxEvents: maximum number of notifications; when config.initialEvent is true, send an immediate notification of the current network type after creation, or UNKNOWN if it cannot be determined (this notification also counts toward the limit)Typical uses
Adjust the app in real time based on the network type, such as video quality or sync frequency
| Event details | Meaning | Example |
|---|---|---|
| data.connectedNetworkType | Current network type: 2G, 3G, 4G, 5G, UNKNOWN | 5G |
| data.subscriptionId | Corresponding subscription ID | 550e8400-… |
| data.terminationReason | Subscription end reasons: MAX_EVENTS_REACHED, NETWORK_TERMINATED, SUBSCRIPTION_EXPIRED, ACCESS_TOKEN_EXPIRED, SUBSCRIPTION_DELETED | SUBSCRIPTION_EXPIRED |
Responses for three scenarios (excerpts)
AIn 5G range
type
org.camaraproject.connected-network-type-subscriptions.v0.network-type-changedNetwork type changeddata.connectedNetworkType
5GCurrent network typeBGo indoors and switch to 4G
type
org.camaraproject.connected-network-type-subscriptions.v0.network-type-changedNetwork type changeddata.connectedNetworkType
4GCurrent network typeCNotification limit reached
type
org.camaraproject.connected-network-type-subscriptions.v0.subscription-endedEndeddata.terminationReason
MAX_EVENTS_REACHEDNotification limit reachedSpec source: CAMARA ConnectedNetworkType r1.2 (Connected Network Type Subscriptions v0.2.0)