- API & Docs
All requests to Twilio's REST API require you to authenticate. Use HTTP basic auth to convey your identity to the API when making requests. Your username is your account sid (a 34 character string, starting with the letters AC). Your password is your auth token. You can find both your account sid and auth token on your Account Dashboard page.
Most HTTP clients (including web-browsers) have a way of providing a username and password for HTTP basic auth. Most clients will also allow you to provide them in the URL itself. For example:
You can retrieve a representation of a resource by GETting its url. The easiest way to do this is to copy and paste a URL into your web browser's address bar.
Creating or updating a resource involves performing an HTTP PUT or HTTP POST to a resource URL. In the PUT or POST, you represent the properties of the object you wish to update as form urlencoded key/value pairs. Don't worry, this is already the way browsers encode POSTs by default.
To delete a resource make an HTTP DELETE request to the resource's URL. Not all Twilio REST API resources support DELETE.
Twilio's REST API uses HTTP GET, POST, PUT and DELETE methods. Since some HTTP clients do not support methods PUT and DELETE, you can simulate them via POST by appending the query string parameter _method (yes, underscore method) to a resource URL. Valid values are PUT and DELETE.
For example, if you want to perform a DELETE request on a particular phone number resource you could:
DELETE /2008-08-01/Accounts/AC309475e5fede1b49e100272a8640f438/PhoneNumbers/PN12345567789AFE4433 HTTP/1.1
But if your client is only capable of GET and POST, then you could perform a POST with a _method query string variable to achieve the same result:
POST /2008-08-01/Accounts/AC309475e5fede1b49e100272a8640f438/PhoneNumbers/PN12345567789AFE4433?_method=DELETE HTTP/1.1