|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.twilio.sdk.client.TwilioCapability
public class TwilioCapability
This class represents a token that will grant someone access to resources within Twilio.
| Nested Class Summary | |
|---|---|
static class |
TwilioCapability.DomainException
|
| Constructor Summary | |
|---|---|
TwilioCapability(String accountSid,
String authToken)
Create a new TwilioCapability with zero permissions. |
|
| Method Summary | |
|---|---|
void |
allowClientIncoming(String clientName)
If the user of this token should be allowed to accept incoming connections then configure the TwilioCapability through this method and specify the client name. |
void |
allowClientOutgoing(String appSid)
Allow the user of this token to make outgoing connections. |
void |
allowClientOutgoing(String appSid,
Map<String,String> params)
Allow the user of this token to make outgoing connections. |
void |
allowEventStream(Map<String,String> filters)
Allow the user of this token to access their event stream. |
String |
generateToken()
Generates a new token based on the credentials and permissions that previously has been granted to this token. |
String |
generateToken(long ttl)
Generates a new token based on the credentials and permissions that previously has been granted to this token. |
static void |
main(String[] args)
Example usage |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TwilioCapability(String accountSid,
String authToken)
accountSid - the account sid to which this token is granted accessauthToken - the secret key used to sign the token. Note, this auth token
is not visible to the user of the token.| Method Detail |
|---|
public void allowClientOutgoing(String appSid)
appSid - the application to which this token grants access
public void allowClientOutgoing(String appSid,
Map<String,String> params)
appSid - the application to which this token grants accessparams - signed parameters that the user of this token cannot
overwrite.public void allowClientIncoming(String clientName)
clientName - public void allowEventStream(Map<String,String> filters)
filters - key/value filters to apply to the event stream
public String generateToken()
throws TwilioCapability.DomainException
TwilioCapability.DomainException
public String generateToken(long ttl)
throws TwilioCapability.DomainException
ttl - the number of seconds before this token expires
TwilioCapability.DomainExceptionpublic static void main(String[] args)
args -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||