Skip to content

Twilio auto configuration

Cyril Schumacher edited this page Feb 3, 2015 · 2 revisions

Twilio auto-configuration

Requirements

For user the Twilio auto-configuration, it requires some prerequisites.

Dependencies

  • twilio-java-sdk

Dependency is used to create an instance of the TwilioRestClient class . It takes three parameters, two of which are required: accountSID, authToken. More information here.

Properties

  • Twilio.accountSID

Account identifier.

  • Twilio.authToken

Authentication token.

Usage

application.yml

In a Spring configuration file (application.yml or application.properties)

twilio:
  accountSID: MY_ACCOUNT_SID
  authToken: MY_AUTHENTICATION_TOKEN

A Java class

In an annotated Java class annotation Component (or derivative):

@Service
public class CustomService {
    @Autowired
    private TwilioRestClient client;
}