2017-09-23 124 views
0

有没有使用REST API将用户添加到Twilio通道的方法?将用户添加到Twilio频道。

from twilio.rest import Client 

# Initialize the client 
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 
token = "your_auth_token" 
client = Client(account, token) 

# Update the channel 
user = client.chat \ 
       .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").users.list()[0] 
channel = client.chat \ 
       .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \ 
       .channels("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").list()[0] 
# How to add user to channel? 

回答