DEVELOPERS BLOG

New AtHoc REST APIs

AtHoc APIs are now new and improved, with AtHoc API V2. Sending and managing alerts have become much easier through the help of powerful REST APIs.

Before you actually write any code, there are a few preliminary steps you need to take. These steps can be found under the “Set up your environment section” of the quick start guide located here. Make sure you follow all the three steps.

Note 1: Be aware that you will not be able to enable your API application without being a System Administrator. You can contact a System Administrator to enable your application for you.

Note 2: You may choose to authorize the application using an implicit grant (this is recommended over password grant). Put <your-app-package>:// as the redirect URI (eg. com.example.athoctest://)

You’re also going to need to set up an alert template and add a device or two to your user if you want to see your alerts being published.

1.     Login to the AtHoc management system

2.     Go to the Users page and click on your user

3.     Click on edit user and put your phone number under SMS Text or your email under Email

4.     Save the user

5.     Click on alert > alert templates

6.     Create a new alert template

7.     Give it a name, description, title, and body

8.     In the “Target users” section, click on “By users” then “Add/Block Users”

9.     Search for your user, check the tick box beside your user and click “apply”

10.    Click “Select Personal Devices” and add the SMS text number and email address you added previously

11.     Save the template

Once your environment is set up, you can start diving into the code.

See you in the next blog where I will talk about using these new AtHoc REST APIs in your iOS and Android apps. 

Nathaniel Johnston

About Nathaniel Johnston

Enterprise Solutions Development Student - IoT