Description
Create a new pixelation graph definition.
Help page
HTTP Method , API endpoint
POST /v1/users/<username>/graphs
Request Header
Key | Description |
---|---|
X-USER-TOKEN | [required] It is the authentication token specified at the time of user registration. |
Request Body
Key | Type | Description |
---|---|---|
id | string | [required] It is an ID for identifying the pixelation graph. Validation rule: ^[a-z][a-z0-9-]{1,16} |
name | string | [required] It is the name of the pixelation graph. |
unit | string | [required] It is a unit of the quantity recorded in the pixelation graph. Ex. commit, kilogram, calory. |
type | string | [required] It is the type of quantity to be handled in the graph. Only int or float are supported. |
color | string | [required] Defines the display color of the pixel in the pixelation graph.shibafu (green), momiji (red), sora (blue), ichou (yellow), ajisai (purple) and kuro (black) are supported as color kind. |
timezone | string | [optional] Specify the timezone for handling this graph as Asia/Tokyo . If not specified, it is treated as UTC . |
selfSufficient | string | [optional] If SVG graph with this field increment or decrement is referenced, Pixel of this graph itself will be incremented or decremented.It is suitable when you want to record the PVs on a web page or site simultaneously. The specification of increment or decrement is the same as Increment a Pixel and Decrement a Pixel with webhook. If not specified, it is treated as none .This feature is limited for Pixela Supporter . About Pixela Supporter , please check How to support Pixela by Patreon / Use Limited Features. |
isSecret | bool | [optional] Graphs with this property's value true are not displayed on the graph list page and can be kept secret.However, this feature is a limited to supporters. For details, please check How to support Pixela by Patreon / Use Limited Features. |
publishOptionalData | bool | [optional] If this property is true , each pixel's optionalData will be added to the generated SVG data as a data-optional attribute.This feature is limited for Pixela Supporter . About Pixela Supporter , please check How to support Pixela by Patreon / Use Limited Features. |
Example
$ curl -X POST https://pixe.la/v1/users/a-know/graphs -H 'X-USER-TOKEN:thisissecret' -d '{"id":"test-graph","name":"graph-name","unit":"commit","type":"int","color":"shibafu","timezone":"Asia/Tokyo","isSecret":true,"publishOptionalData":true}' {"message":"Success.","isSuccess":true}