more details and japanese document are here.
To create graphs or update data, make a request to the following URL via a POST method.
<%= url_for '/', :full %>api/:service_name/:section_name/:graph_name
The names of the items within the URL to POST to are shown in the table to the right.
You can use multi-byte strings for each item name as long as it is UTF-8.
The Name Used in the Example | Purpose | Actual Parameters |
---|---|---|
:service_name | The name of the service that you'd like to graph | blog, photo, place, socialgame |
:section_name | The name of the feature or system to graph, within said service. | entry, user, spot, items |
:graph_name | The actual name of the value being graphed | total_entry, kakin_user, muryo_user |
For example, if we are graphing the number of registered users in a social game, we would POST to the following URL:
<%= url_for '/', :full %>api/socialgame/member/register
Also, we would use the following parametens when POSTing.
Parameter | Description | Required/Optional |
---|---|---|
number | The number to give the graph | Required |
mode |
Update method for the number: count, modified, gauge。
⚠ The data type is determined at first time. Can't change mode from DERIVE to other and other to DERIVE. |
Optional |
color | The color of the grah. Specify with #FFFFFF format. | Optional (auto-generated if unspecified in a new graph) |
description | short description of this Graph | Option |
The example below shows how to create a new graph or update an existing one, using Perl's LWP module.
my $ua = LWP::UserAgent->new; $ua->post('<%= url_for '/', :full %>api/socialgame/member/register', { number => 10, color => '#333399' });
If using curl:
$ curl -F number=10 <%= url_for '/', :full %>api/socialgame/member/register