2017-04-26 18 views
0

Twilio最近停止了他們的配置文件SID,轉而使用新的Room Rest API。如何使用Twilio新Room Rest API而不是Configuration Profile SID?

以前我用來創建一個配置文件SID授予訪問令牌,然後通過訪問令牌JavaScript來連接參與者:

$callerCallId = substr(md5(microtime()), 0, 15); 
$callerAccessToken = new Services_Twilio_AccessToken($accountSid, $apiKeySid, $apiKeySecret, 3600, $callerCallId); 
$callerConversationGrant = new Services_Twilio_Auth_ConversationsGrant(); 
$callerConversationGrant->setConfigurationProfileSid($configurationProfileSid); 
$callerAccessToken->addGrant($callerConversationGrant); 
$callerToken = $callerAccessToken->toJWT(); 

有了新的REST API,我該怎麼辦? Twilio的官方文檔根本沒有幫助。

回答

0

Twilio開發人員在這裏傳播。

如果您正在使用Video Group Rooms的私人測試版,那麼您應該可以看到documentation here。實際上,您不需要更改任何有關授權用戶的方式,但仍需要從服務器生成JWT並將其傳遞給客戶端。

區別在於,不是從客戶端創建和加入房間,而是首先需要use the REST API to create the room。然後,您可以使用客戶端中的房間名稱加入該房間。

如果您對API,文檔或任何關於Group Rooms的反饋,請通過[email protected]與視頻團隊聯繫。