Obtaining device_token Before Streaming
Function
This API is used for the tenant instance to obtain device_token before streaming.
Before calling this API, ensure that the tenant has purchased an instance.
The obtained device_token of the cloud phone instance is used as the authentication information and carries device_id to call the signaling address (signaling_url) in the response parameter.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
koophone:cloudphoneResource:executeInstanceAuthToken
Write
cloudphoneResource *
-
-
-
URI
POST /v1/instances/{instance_id}/auth
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
instance_id |
Yes |
String |
Instance ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
x-auth-token |
Yes |
String |
IAM token information of the tenant. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
data |
data object |
All response parameter information. |
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
|
Parameter |
Type |
Description |
|---|---|---|
|
streamingId |
String |
Stream ID. |
|
resource |
resource object |
Resource set. |
|
device_token |
String |
Device authentication token. |
|
Parameter |
Type |
Description |
|---|---|---|
|
sdk |
sdk object |
SDK information. |
|
rtc |
rtc object |
RTC information. |
|
device_id |
String |
Device ID. |
|
kp_id |
String |
Cloud phone instance ID, for example, whklpuo1. |
|
Parameter |
Type |
Description |
|---|---|---|
|
internal |
internal object |
Internal network information. |
|
external |
external object |
External network information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
address |
String |
Internal IP address. |
|
aport |
String |
Audio port. |
|
atype |
String |
Audio type. |
|
address_ipv6 |
String |
IPv6 address. |
|
Parameter |
Type |
Description |
|---|---|---|
|
address |
String |
External EIP. |
|
aport |
Integer |
Audio port. |
|
atype |
Integer |
Audio type. |
|
address_ipv6 |
String |
External IPv6 address. |
|
Parameter |
Type |
Description |
|---|---|---|
|
ice_signaling |
ice_signaling object |
ICE signaling information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
signaling_url |
String |
Signaling service access address. |
|
expired_time |
String |
Streaming duration, in seconds. |
|
ice_servers |
Array of strings |
ICE server. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
0: successful. KOOPHONE.API.1000: The request parameter is incorrect. KOOPHONE.API.1001: Insufficient instance permissions. KOOPHONE.API.9999: Internal service error. |
|
error_msg |
String |
Error message. |
Example Requests
POST API. The request URL carries the instance purchased by the tenant and the tenant token.
/v1/instances/Q39YyZvI/auth
Example Responses
Status code: 200
OK
{
"data" : {
"resource" : {
"sdk" : {
"internal" : {
"address" : null,
"aport" : null,
"atype" : null,
"address_ipv6" : null
},
"external" : {
"address" : "10.83.71.187",
"aport" : 10030,
"atype" : 1,
"address_ipv6" : null
}
},
"rtc" : {
"ice_signaling" : {
"signaling_url" : "http://100.93.2.248:18082",
"expired_time" : null,
"ice_servers" : [ ]
}
},
"device_id" : "7b0cd026df8d495b8a65d628d7bec433",
"kp_id" : "Q39YyZvI"
},
"device_token" : "dee5081f40c83ddea3ded91c387351e9"
},
"error_code" : "0",
"error_msg" : "ok"
}
Status code: 400
Bad Request
{
"error_code" : "string",
"error_msg" : "string"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
Bad Request |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot