Guest User

Untitled

a guest
Oct 4th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import Foundation
  2. import Alamofire
  3.  
  4. if let accountSID = ProcessInfo.processInfo.environment["TWILIO_ACCOUNT_SID"],
  5. let authToken = ProcessInfo.processInfo.environment["TWILIO_AUTH_TOKEN"] {
  6.  
  7. let url = "https://api.twilio.com/2010-04-01/Accounts/(accountSID)/Calls"
  8. let parameters = ["From": "YOUR_TWILIO_NUMBER", "To": "YOUR_PERSONAL_NUMBER", "Url": "YOUR_TWIML_URL"]
  9.  
  10. Alamofire.request(url, method: .post, parameters: parameters)
  11. .authenticate(user: accountSID, password: authToken)
  12. .responseJSON { response in
  13. debugPrint(response)
  14. }
  15.  
  16. RunLoop.main.run()
  17. }
Add Comment
Please, Sign In to add comment