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 a KooPhone cloud phone 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.
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. 0 indicates success. |
error_msg |
String |
Error message. |
Parameter |
Type |
Description |
---|---|---|
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. Unit: s. |
ice_servers |
Array of strings |
ICE server. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful. |
error_msg |
String |
Response description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Response code. The error code specification is KOOPHONE.API.0001, and the number increases in ascending order. If error_code is 0, the operation is successful. |
error_msg |
String |
Response description. |
Example Requests
POST API. The request URL carries the KooPhone 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.xx.xx.xxx", "aport" : 10030, "atype" : 1, "address_ipv6" : null } }, "rtc" : { "ice_signaling" : { "signaling_url" : "http://xxxxxxxxxx", "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 code: 500
Internal Server Error
{ "error_code" : "string", "error_msg" : "string" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
500 |
Internal Server Error |
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