Ping API

Pinging happens on connect.oahu.fr.

POST /actions/stats/ping
GET /actions/stats/ping/:type

You can either get or post to ping the stats API.
The GET request is meant to allow you to ping using a pixel image.

Response

When POSTing

When you’re posting, we render back a JSON object which the stats for the provided type, for today and the total.

{
  :today => 1,
  :total => 15
}

When GETting

When you’re getting, we render a basic JSON object which just says “OK”.

{:status => "OK"}

Parameters

Type

The type parameter you specify allows you to specify what means your ping.
It could be, for example, “views”, to symbolize viewing a video or a page.

When you’re posting, this parameter should be provided in the form parameters.
When you’re getting, it should be provided in the URI.

If you don’t specify any type (when posting), it’ll be “ping” by default.

Value

Sometimes, you want to specify a value to the ping you just did.
The value will be stored and can be used in the backend later to retrieve only the pings which have the specified value.
Or to group the pings by this value.

When you’re posting, this parameter should be provided in the form parameters.
When you’re getting, it should be provided as a GET parameter ?value=xx

If you don’t specify any value, the default will be the referer.