About API
Our API is a REST API, which supports HTTP error codes to indicate API errors and uses basic HTTP authentication to authenticate user’s account. All requests body must be in JSON format, we do not support other formats. However, we’re open-minded team and we are open to any suggestions on formats or API logic. Please, write us [email protected] if you have got any suggestions or issues with the API.
In addition to the REST API we provide our clients 8.4. 🇬🇧 Website SDK API, which is essentially a JavaScript API designed to manage your subscriber’s database. For example, this SDK provides functions for tagging and setting aliases for your subscribers. Those tags and aliases could be useful for marketing purposes, such as – segmentation of subscribers’ database by their behaviour or by their preferences.
Authentication
Authenticate your account when using the API by including your APP KEY and APP SECRET keys in the request. You can find your APP keys in the Site Settings page.
âš Your APP key allows you to send push messages to all your subscribers, so be careful and keep them in secret!
Authentication to the APP is performed via HTTP Basic Auth:
Code example:
// via shell
// example APP_KEY = 1e26f7bb3f81e1ab789d3e20b9cf6325
// example APP_SECRET = 9bb59fcbff38b85647c421c65cca06ce
curl -X \\
-u "1e26f7bb3f81e1ab789d3e20b9cf6325:9bb59fcbff38b85647c421c65cca06ce" \\
-H "Content-Type: application/json" \\
<https://uapi.gravitec.net/api/v3/push>
// or
curl -X \\
-u "1e26f7bb3f81e1ab789d3e20b9cf6325:9bb59fcbff38b85647c421c65cca06ce" \\
-H "Content-Type: application/json" \\
<https://uapi.gravitec.net/api/v3/push>