File tree 7 files changed +128
-0
lines changed
7 files changed +128
-0
lines changed Original file line number Diff line number Diff line change
1
+ const twilio = require ( 'twilio' ) ;
2
+
3
+ const myAccountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ; // Your Account SID from www.twilio.com/console
4
+ const apiKey = 'SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ; // You can generate this from www.twilio.com/console/runtime/api-keys/create
5
+ const apiSecret = 'your_api_secret' ; // You can generate this from www.twilio.com/console/runtime/api-keys/create
6
+
7
+ // DANGER! This is insecure. See http://twil.io/secure
8
+ const client = twilio ( apiKey , apiSecret , { accountSid : myAccountSid } ) ;
9
+
10
+ // Proof request to check credentials are working.
11
+ // Retrieving your account information
12
+ client . api . accounts . each ( accounts => console . log ( accounts . sid ) ) ;
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using Twilio ;
3
+ using Twilio . Rest . Api . V2010 ;
4
+
5
+
6
+ class Program
7
+ {
8
+ static void Main ( string [ ] args )
9
+ {
10
+ const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ; // Your Account Sid from twilio.com/user/account
11
+ const string apiKey = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ; // You can generate this from www.twilio.com/console/runtime/api-keys/create
12
+ const string apiSecret = "your_api_secret" ; // You can generate this from www.twilio.com/console/runtime/api-keys/create
13
+
14
+ // DANGER! This is insecure. See http://twil.io/secure
15
+ TwilioClient . Init ( apiKey , apiSecret , accountSid ) ;
16
+
17
+ // Proof request to check credentials are working.
18
+ // Retrieving your account information
19
+ var accounts = AccountResource . Read ( ) ;
20
+
21
+ foreach ( var record in accounts )
22
+ {
23
+ Console . WriteLine ( record . Sid ) ;
24
+ }
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ require_once './vendor/autoload.php ' ; // Loads the library
3
+ use Twilio \Rest \Client ;
4
+
5
+ $ sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " ; // Your Account Sid from twilio.com/user/account
6
+ $ api_key = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " ; // You can generate this from www.twilio.com/console/runtime/api-keys/create
7
+ $ api_secret = "your_api_secret " ; // You can generate this from www.twilio.com/console/runtime/api-keys/create
8
+
9
+ // DANGER! This is insecure. See http://twil.io/secure
10
+ $ client = new Client ($ api_key , $ api_secret , $ sid );
11
+
12
+ // Proof request to check credentials are working.
13
+ // Retrieving your account information
14
+ $ accounts = $ client ->api ->v2010 ->accounts
15
+ ->read ();
16
+
17
+ foreach ($ accounts as $ record ) {
18
+ print ($ record ->sid );
19
+ }
20
+ ?>
Original file line number Diff line number Diff line change
1
+ require 'twilio-ruby'
2
+
3
+ account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Your Account SID from www.twilio.com/console
4
+ api_key = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # You can generate this from www.twilio.com/console/runtime/api-keys/create
5
+ api_secret = "your_api_secret" # You can generate this from www.twilio.com/console/runtime/api-keys/create
6
+
7
+ # DANGER! This is insecure. See http://twil.io/secure
8
+ @client = Twilio ::REST ::Client . new api_key , api_secret , account_sid
9
+
10
+ # Proof request to check credentials are working.
11
+ # Retrieving your account information
12
+ accounts = @client . api . accounts . list
13
+
14
+ accounts . each do |record |
15
+ puts record . sid
16
+ end
Original file line number Diff line number Diff line change
1
+ from twilio .rest import Client
2
+
3
+ account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Your Account SID from www.twilio.com/console
4
+ api_key = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # You can generate this from www.twilio.com/console/runtime/api-keys/create
5
+ api_secret = "your_api_secret" # You can generate this from www.twilio.com/console/runtime/api-keys/create
6
+
7
+ # DANGER! This is insecure. See http://twil.io/secure
8
+ client = Client (api_key , api_secret , account_sid )
9
+
10
+ # Proof request to check credentials are working.
11
+ # Retrieving your account information
12
+ accounts = client .api .accounts .list ()
13
+ for record in accounts :
14
+ print (record .sid )
Original file line number Diff line number Diff line change
1
+ import com .twilio .Twilio ;
2
+ import com .twilio .base .ResourceSet ;
3
+ import com .twilio .rest .api .v2010 .Account ;
4
+
5
+ public class Example {
6
+ // Find your Account Sid at twilio.com/user/account
7
+ public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
8
+ // You can generate these from www.twilio.com/console/runtime/api-keys/create
9
+ public static final String API_KEY = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
10
+ public static final String API_SECRET = "your_api_secret" ;
11
+
12
+ public static void main (String [] args ) {
13
+ // DANGER! This is insecure. See http://twil.io/secure
14
+ Twilio .init (API_KEY , API_SECRET , ACCOUNT_SID );
15
+
16
+ // Proof request to check credentials are working.
17
+ // Retrieving your account information
18
+ ResourceSet <Account > accounts = Account .reader ().read ();
19
+
20
+ for (Account record : accounts ) {
21
+ System .out .println (record .getSid ());
22
+ }
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " server" ,
3
+ "title" : " Authenticate with API Key and API Secret" ,
4
+ "_definition" : {
5
+ "params" : {
6
+ "required" : {},
7
+ "path" : {}
8
+ },
9
+ "location" : " https://api.twilio.com/2010-04-01/Accounts.json" ,
10
+ "method" : " post" ,
11
+ "domain" : " api" ,
12
+ "version" : " v2010" ,
13
+ "resource" : " account" ,
14
+ "action" : " read"
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments