Created
September 7, 2011 21:59
-
-
Save Beans0063/1201918 to your computer and use it in GitHub Desktop.
Twilio Client Capability Token in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import com.twilio.sdk.client.TwilioCapability; | |
import com.twilio.sdk.client.TwilioCapability.DomainException; | |
public class Capability { | |
public static void main(String[] args) { | |
String accountSid="ACxxx"; | |
String authToken="yyyyy"; | |
String appSid="APxxxx"; | |
TwilioCapability capability = new TwilioCapability(accountSid, authToken); | |
capability.allowClientOutgoing(appSid); | |
capability.allowClientIncoming("alice"); | |
try { | |
System.out.println(capability.generateToken()); | |
} catch (DomainException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment