- Prerequisities
- Introduction
- Basic Config
- Advanced Config
- How to get the Account SID, Auth Token, and Twilio Number
This guide assumes:
- You are familiar with JSON formatting
- You have read and understood the Alarms Wiki
- You are comfortable with the layout of
alarms.json
.
Twilio allows software developers to programmatically make and receive phone calls and send and receive text messages using its web service APIs.
PokeAlarm offers the following for Twilio:
- Personalized notifications via Dynamic Text Substitution
These alarms.json
parameters are required to enable the alarm service:
Parameters | Description |
---|---|
type |
must be twilio |
active |
'True' for alarm to be active |
account_sid |
Your Account SID from Twilio |
auth_token |
Your Auth Token from Twilio |
from_number |
Your Twilio number to send from |
to_number |
Your number to receive texts from |
{
"active": "True",
"type":"twilio",
"account_sid":"YOUR_API_KEY",
"auth_token":"YOUR_AUTH_TOKEN",
"from_number":"YOUR_FROM_NUM",
"to_number":"YOUR_TO_NUM"
}
Note: The above code is to be inserted into the alarms section of alarms.json. It does not represent the entire alarms.json file.
In addition to the above required parameters, several optional parameters are available to personalize your notifications.
These optional parameters below are applicable to the pokemon
, pokestop
, gym
, egg
, and raid
alarm code of the JSON file.
Parameters | Description | Default |
---|---|---|
message |
Text message for pokemon updates | "A wild <pkmn> has appeared! <gmaps> Available until <24h_time> (<time_left>)." |
Parameters | Description | Default |
---|---|---|
message |
Text message for pokestop updates | "Someone has placed a lure on a Pokestop! <gmaps> Lure will expire at <24h_time> (<time_left>)." |
Parameters | Description | Default |
---|---|---|
message |
Text message for gym updates | "A Team <old_team> gym has fallen! It is now controlled by <new_team>. <gmaps>" |
Below is an example of these optional parameters and how they are incorporated into a functional alarm layout.
{
"active": "True",
"type":"twilio",
"account_sid":"YOUR_API_KEY",
"auth_token":"YOUR_AUTH_TOKEN",
"from_number":"YOUR_FROM_NUM",
"to_number":"YOUR_TO_NUM",
"pokemon":{
"from_number":"YOUR_FROM_NUM",
"to_number":"YOUR_TO_NUM",
"message": "A wild <pkmn> has appeared! <gmaps> Available until <24h_time> (<time_left>)."
},
"pokestop":{
"from_number":"YOUR_FROM_NUM",
"to_number":"YOUR_TO_NUM",
"message": "Someone has placed a lure on a Pokestop! <gmaps> Lure will expire at <24h_time> (<time_left>)."
},
"gym":{
"from_number":"YOUR_FROM_NUM",
"to_number":"YOUR_TO_NUM",
"message": "A Team <old_team> gym has fallen! It is now controlled by <new_team>. <gmaps>"
},
"egg": {
"message": "A level <raid_level> raid is incoming! <gmap> Egg hatches <begin_24h_time> (<begin_time_left>)."
},
"raid": {
"message": "A raid on <pkmn> is available! <gmap> Available until <24h_time> (<time_left>)."
}
}
Note: The above code is to be inserted into the alarms section of alarms.json. It does not represent the entire alarms.json file.
-
Go to Twilio and click 'Get a free API key'. Fill out the following form, and enter your phone number to verify your account.
-
On the left hand side, click the Home Button and then click Dashboard. The Account SID and Auth Token will be listed. To reveal the Auth Token, click on the lock next to it.
-
Scroll down and click on '# Phone Numbers'. Then click 'Get Started' to get your free number.
-
If you wish to text to different numbers, you need to register each before you are allowed to message them. This can be done from the 'Verified Caller ID's' page.