getStreamUrl: Get RTSP stream URL
getStreamUrl: Get RTSP stream URL
Function details
Return an RTSP playback URL for a device channel authorized to your OAuth project. Use the OAuth project Access Key as system.appId and the end user's OAuth access token in params.token.
Obtain tokens with oauthTokenV2. Product context: OAuth 2.0 authorization.
Request address
https://openapi-[DataCenter].easy4ip.com/openapi/getStreamUrl
Request format
HTTP POST. JSON body layout: Request conventions. Sign with Signature.
Incoming parameter description
| Parameter name | Parameter type | Required | Description |
|---|---|---|---|
| token | String | Yes | End user OAuth access token (Ot_) |
| deviceId | String | Yes | Device serial number |
| productId | String | No | IoT device product id |
| channelId | Integer | Yes | Channel id |
| streamId | Integer | Yes | Stream type: 0 main stream, 1 sub stream |
Sample input
{
"system": {
"ver": "1.0",
"appId": "<OAuth Project Access Key>",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time": 1603366946,
"nonce": "2e84717c-0f22-4424-8afe-19bab0d6d606"
},
"id": "051824b1-9655-4755-9cc2-adcc9ab5fef1",
"params": {
"token": "Ot_xxxxxxxxxxxxxxxxxx",
"deviceId": "TESTQWERXXXX",
"channelId": 0,
"streamId": 0
}
}
Return data field description
| Field | Type | Description |
|---|---|---|
| url | String | RTSP stream URL for third-party players |
Sample output
{
"result": {
"msg": "The operation was successful.",
"code": "0",
"data": {
"url": "rtsp://example.lechange.com/live/xxxxxxxx"
}
},
"id": "051824b1-9655-4755-9cc2-adcc9ab5fef1"
}
Error codes
This method may return the codes below. See Return codes and Capability errors for the full catalog.
Gateway and auth (SN / TK / OP)
| Code | Meaning | Next step |
|---|---|---|
SN1001 | Signature error | Check sign per Development specification |
TK1002 | Token invalid or expired | Refresh accessToken |
OP1002 | Missing required parameter | Add required fields |
OP1003 | Invalid parameter | Match this page’s parameter table |
OP1009 | Permission denied | Check token and device bind/share grants |
OP1013 | Total call limit exceeded | Reduce call rate |
OP1014 | Daily per-interface limit exceeded | See Interface call limits |
DV1007 | Device offline | Wait until the device is online |
See Return codes · OP/SN/TK for the full catalog.
Sub-accounts (SUB)
| Code | Meaning | Next step |
|---|---|---|
SUB1001–SUB1002 | Sub-account lacks API permission | Update policy via addPolicy |
SUB1005 | Sub-account token expired | Refresh subAccountToken |
SUB1006 | No device grant for sub-account | Check Resource and device serial |
SUB1008 | Sub-account not bound to app | Create and bind the sub-account first |
See Return codes · SUB.
