Server API Overview

About API

Our API is a REST API, which supports HTTP error codes to indicate API errors and use 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 opened for any suggestions on formats or API logic. Please, write us support@gravitec.net if you have got any suggestions or issues with the API.

In addition to the REST API we provide to our clients WEB 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 to your subscribers. Those tags and aliases could be useful for marketing purposes, such as – segmentation of subscribers’ database by their behavior 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 to send push messages to all your subscribers database, so be careful and keep them in secret!

Authentication to the APP is performed via HTTP Basic Auth:

  • Provide your application key ("APP_KEY") as the basic AUTH username value
  • Provide your application secret ("APP_SECRET") as the basic AUTH password value
  • All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

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