C# Class Twilio.TwilioRestClient

Afficher le fichier Open project: twilio/twilio-csharp Class Usage Examples

Méthodes publiques

Méthode Description
DeleteCall ( string callSid ) : DeleteStatus

Deletes the single Call resource identified by {callSid}.

DeleteCall ( string callSid, Action callback ) : void

Deletes a single Call resource identified by {CallSid}.

GetCall ( string callSid ) : Call

Returns the single Call resource identified by {CallSid} Makes a GET request to a Call Instance resource.

GetCall ( string callSid, Action callback ) : void

Returns the single Call resource identified by {CallSid}

GetCallAsync ( string callSid ) : IAsyncOperation

Returns the single Call resource identified by {CallSid} Makes a GET request to a Call Instance resource.

HangupCall ( string callSid, HangupStyle style ) : Call

Hangs up a call in progress. Makes a POST request to a Call Instance resource.

HangupCall ( string callSid, HangupStyle style, Action callback ) : void

Hangs up a call in progress.

HangupCallAsync ( string callSid, HangupStyle style ) : IAsyncOperation

Hangs up a call in progress. Makes a POST request to a Call Instance resource.

InitiateOutboundCall ( CallOptions options ) : Call

Initiates a new phone call. Makes a POST request to the Calls List resource.

InitiateOutboundCall ( string from, string to, string url ) : Call

Initiates a new phone call. Makes a POST request to the Calls List resource.

InitiateOutboundCall ( string from, string to, string url, string statusCallback ) : Call

Initiates a new phone call. Makes a POST request to the Calls List resource.

InitiateOutboundCall ( CallOptions options, Action callback ) : void

Initiates a new phone call.

InitiateOutboundCall ( string from, string to, string url, Action callback ) : void

Initiates a new phone call.

InitiateOutboundCall ( string from, string to, string url, string statusCallback, Action callback ) : void

Initiates a new phone call.

InitiateOutboundCallAsync ( CallOptions options ) : IAsyncOperation

Initiates a new phone call. Makes a POST request to the Calls List resource.

InitiateOutboundCallAsync ( string from, string to, string url ) : IAsyncOperation

Initiates a new phone call. Makes a POST request to the Calls List resource.

InitiateOutboundCallAsync ( string from, string to, string url, string statusCallback ) : IAsyncOperation

Initiates a new phone call. Makes a POST request to the Calls List resource.

ListCalls ( ) : CallResult

Returns a paged list of phone calls made to and from the account. Makes a GET request to the Calls List resource.

ListCalls ( CallListRequest options ) : CallResult

Returns a paged list of phone calls made to and from the account. Makes a GET request to the Calls List resource.

ListCalls ( string To ) : CallResult

Returns a paged list of phone calls made to and from the account. Makes a GET request to the Calls List resource.

ListCalls ( Action callback ) : void

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first.

ListCalls ( CallListRequest options, Action callback ) : void

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first.

ListCallsAsync ( ) : IAsyncOperation

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first. Makes a GET request to the Calls List resource.

ListCallsAsync ( CallListRequest options ) : IAsyncOperation

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first. Makes a GET request to the Calls List resource.

RedirectCall ( string callSid, CallOptions options ) : Call

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.

RedirectCall ( string callSid, string redirectUrl, string redirectMethod ) : Call

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.

RedirectCall ( string callSid, CallOptions options, Action callback ) : void

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.

RedirectCall ( string callSid, string redirectUrl, string redirectMethod, Action callback ) : void

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.

RedirectCallAsync ( string callSid, string redirectUrl, string redirectMethod ) : IAsyncOperation

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.

Private Methods

Méthode Description
AddCallListOptions ( Twilio.CallListRequest options, RestRequest request ) : void
AddCallOptions ( CallOptions options, RestRequest request ) : void
GetCallAsyncInternal ( string callSid ) : Task
HangupCallAsyncInternal ( string callSid, HangupStyle style ) : Task
InitiateOutboundCallAsyncInternal ( CallOptions options ) : Task
ListCallsAsyncInternal ( ) : Task
ListCallsAsyncInternal ( CallListRequest options ) : Task
RedirectCallAsyncInternal ( string callSid, string redirectUrl, string redirectMethod ) : Task

Method Details

DeleteCall() public méthode

Deletes the single Call resource identified by {callSid}.
public DeleteCall ( string callSid ) : DeleteStatus
callSid string The Sid of the Call resource to delete.
Résultat DeleteStatus

DeleteCall() public méthode

Deletes a single Call resource identified by {CallSid}.
public DeleteCall ( string callSid, Action callback ) : void
callSid string The Sid of the Call resource to delete.
callback Action Method to call upon completion.
Résultat void

GetCall() public méthode

Returns the single Call resource identified by {CallSid} Makes a GET request to a Call Instance resource.
public GetCall ( string callSid ) : Call
callSid string The Sid of the Call resource to retrieve
Résultat Call

GetCall() public méthode

Returns the single Call resource identified by {CallSid}
public GetCall ( string callSid, Action callback ) : void
callSid string The Sid of the Call resource to retrieve
callback Action Method to call upon successful completion
Résultat void

GetCallAsync() public méthode

Returns the single Call resource identified by {CallSid} Makes a GET request to a Call Instance resource.
public GetCallAsync ( string callSid ) : IAsyncOperation
callSid string The Sid of the Call resource to retrieve
Résultat IAsyncOperation

HangupCall() public méthode

Hangs up a call in progress. Makes a POST request to a Call Instance resource.
public HangupCall ( string callSid, HangupStyle style ) : Call
callSid string The Sid of the call to hang up.
style HangupStyle 'Canceled' will attempt to hangup calls that are queued or ringing but not affect calls already in progress. 'Completed' will attempt to hang up a call even if it's already in progress.
Résultat Call

HangupCall() public méthode

Hangs up a call in progress.
public HangupCall ( string callSid, HangupStyle style, Action callback ) : void
callSid string The Sid of the call to hang up.
style HangupStyle 'Canceled' will attempt to hangup calls that are queued or ringing but not affect calls already in progress. 'Completed' will attempt to hang up a call even if it's already in progress.
callback Action Method to call upon successful completion
Résultat void

HangupCallAsync() public méthode

Hangs up a call in progress. Makes a POST request to a Call Instance resource.
public HangupCallAsync ( string callSid, HangupStyle style ) : IAsyncOperation
callSid string The Sid of the call to hang up.
style HangupStyle 'Canceled' will attempt to hangup calls that are queued or ringing but not affect calls already in progress. 'Completed' will attempt to hang up a call even if it's already in progress.
Résultat IAsyncOperation

InitiateOutboundCall() public méthode

Initiates a new phone call. Makes a POST request to the Calls List resource.
public InitiateOutboundCall ( CallOptions options ) : Call
options CallOptions Call settings. Only properties with values set will be used.
Résultat Call

InitiateOutboundCall() public méthode

Initiates a new phone call. Makes a POST request to the Calls List resource.
public InitiateOutboundCall ( string from, string to, string url ) : Call
from string The phone number to use as the caller id. Format with a '+' and country code e.g., +16175551212 (E.164 format). Must be a Twilio number or a valid outgoing caller id for your account.
to string The number to call formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
url string The fully qualified URL that should be consulted when the call connects. Just like when you set a URL for your inbound calls. URL should return TwiML.
Résultat Call

InitiateOutboundCall() public méthode

Initiates a new phone call. Makes a POST request to the Calls List resource.
public InitiateOutboundCall ( string from, string to, string url, string statusCallback ) : Call
from string The phone number to use as the caller id. Format with a '+' and country code e.g., +16175551212 (E.164 format). Must be a Twilio number or a valid outgoing caller id for your account.
to string The number to call formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
url string The fully qualified URL that should be consulted when the call connects. Just like when you set a URL for your inbound calls. URL should return TwiML.
statusCallback string A URL that Twilio will request when the call ends to notify your app.
Résultat Call

InitiateOutboundCall() public méthode

Initiates a new phone call.
public InitiateOutboundCall ( CallOptions options, Action callback ) : void
options CallOptions Call settings. Only properties with values set will be used.
callback Action Method to call upon successful completion
Résultat void

InitiateOutboundCall() public méthode

Initiates a new phone call.
public InitiateOutboundCall ( string from, string to, string url, Action callback ) : void
from string The phone number to use as the caller id. Format with a '+' and country code e.g., +16175551212 (E.164 format). Must be a Twilio number or a valid outgoing caller id for your account.
to string The number to call formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
url string The fully qualified URL that should be consulted when the call connects. Just like when you set a URL for your inbound calls. URL should return TwiML.
callback Action Method to call upon successful completion
Résultat void

InitiateOutboundCall() public méthode

Initiates a new phone call.
public InitiateOutboundCall ( string from, string to, string url, string statusCallback, Action callback ) : void
from string The phone number to use as the caller id. Format with a '+' and country code e.g., +16175551212 (E.164 format). Must be a Twilio number or a valid outgoing caller id for your account.
to string The number to call formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
url string The fully qualified URL that should be consulted when the call connects. Just like when you set a URL for your inbound calls. URL should return TwiML.
statusCallback string A URL that Twilio will request when the call ends to notify your app.
callback Action Method to call upon successful completion
Résultat void

InitiateOutboundCallAsync() public méthode

Initiates a new phone call. Makes a POST request to the Calls List resource.
public InitiateOutboundCallAsync ( CallOptions options ) : IAsyncOperation
options CallOptions Call settings. Only properties with values set will be used.
Résultat IAsyncOperation

InitiateOutboundCallAsync() public méthode

Initiates a new phone call. Makes a POST request to the Calls List resource.
public InitiateOutboundCallAsync ( string from, string to, string url ) : IAsyncOperation
from string The phone number to use as the caller id. Format with a '+' and country code e.g., +16175551212 (E.164 format). Must be a Twilio number or a valid outgoing caller id for your account.
to string The number to call formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
url string The fully qualified URL that should be consulted when the call connects. Just like when you set a URL for your inbound calls. URL should return TwiML.
Résultat IAsyncOperation

InitiateOutboundCallAsync() public méthode

Initiates a new phone call. Makes a POST request to the Calls List resource.
public InitiateOutboundCallAsync ( string from, string to, string url, string statusCallback ) : IAsyncOperation
from string The phone number to use as the caller id. Format with a '+' and country code e.g., +16175551212 (E.164 format). Must be a Twilio number or a valid outgoing caller id for your account.
to string The number to call formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
url string The fully qualified URL that should be consulted when the call connects. Just like when you set a URL for your inbound calls. URL should return TwiML.
statusCallback string A URL that Twilio will request when the call ends to notify your app.
Résultat IAsyncOperation

ListCalls() public méthode

Returns a paged list of phone calls made to and from the account. Makes a GET request to the Calls List resource.
public ListCalls ( ) : CallResult
Résultat CallResult

ListCalls() public méthode

Returns a paged list of phone calls made to and from the account. Makes a GET request to the Calls List resource.
public ListCalls ( CallListRequest options ) : CallResult
options CallListRequest List filter options. If an property is set the list will be filtered by that value.
Résultat CallResult

ListCalls() public méthode

Returns a paged list of phone calls made to and from the account. Makes a GET request to the Calls List resource.
public ListCalls ( string To ) : CallResult
To string
Résultat CallResult

ListCalls() public méthode

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first.
public ListCalls ( Action callback ) : void
callback Action Method to call upon successful completion
Résultat void

ListCalls() public méthode

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first.
public ListCalls ( CallListRequest options, Action callback ) : void
options CallListRequest List filter options. If an property is set the list will be filtered by that value.
callback Action Method to call upon successful completion
Résultat void

ListCallsAsync() public méthode

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first. Makes a GET request to the Calls List resource.
public ListCallsAsync ( ) : IAsyncOperation
Résultat IAsyncOperation

ListCallsAsync() public méthode

Returns a paged list of phone calls made to and from the account. Sorted by DateUpdated with most-recent calls first. Makes a GET request to the Calls List resource.
public ListCallsAsync ( CallListRequest options ) : IAsyncOperation
options CallListRequest List filter options. If an property is set the list will be filtered by that value.
Résultat IAsyncOperation

RedirectCall() public méthode

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.
public RedirectCall ( string callSid, CallOptions options ) : Call
callSid string The Sid of the call to redirect
options CallOptions Call settings. Only Url, Method, FallbackUrl, FallbackMethod, StatusCallback and StatusCallbackMethod properties with values set will be used.
Résultat Call

RedirectCall() public méthode

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.
public RedirectCall ( string callSid, string redirectUrl, string redirectMethod ) : Call
callSid string The Sid of the call to redirect
redirectUrl string The URL to redirect the call to.
redirectMethod string The HTTP method to use when requesting the redirectUrl
Résultat Call

RedirectCall() public méthode

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.
public RedirectCall ( string callSid, CallOptions options, Action callback ) : void
callSid string The Sid of the call to redirect
options CallOptions Call settings. Only Url, Method, FallbackUrl, FallbackMethod, StatusCallback and StatusCallbackMethod properties with values set will be used.
callback Action Method to call upon successful completion
Résultat void

RedirectCall() public méthode

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.
public RedirectCall ( string callSid, string redirectUrl, string redirectMethod, Action callback ) : void
callSid string The Sid of the call to redirect
redirectUrl string The URL to redirect the call to.
redirectMethod string The HTTP method to use when requesting the redirectUrl
callback Action Method to call upon successful completion
Résultat void

RedirectCallAsync() public méthode

Redirect a call in progress to a new TwiML URL. Makes a POST request to a Call Instance resource.
public RedirectCallAsync ( string callSid, string redirectUrl, string redirectMethod ) : IAsyncOperation
callSid string The Sid of the call to redirect
redirectUrl string The URL to redirect the call to.
redirectMethod string The HTTP method to use when requesting the redirectUrl
Résultat IAsyncOperation