Example.1
Example.1 Pixelation graph of pushed commit
"Pixel" is â– â– â– â– â– ! / Record, and Visualize.
Pixela is easy to start with 3 steps.
$ curl -X POST https://pixe.la/v1/users -d '{"token":"thisissecret", "username":"a-know", "agreeTermsOfService":"yes", "notMinor":"yes"}'
{"message":"Success.","isSuccess":true}
$ 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"}'
{"message":"Success.","isSuccess":true}
Browse https://pixe.la/v1/users/a-know/graphs/test-graph
!
$ curl -X POST https://pixe.la/v1/users/a-know/graphs/test-graph -H 'X-USER-TOKEN:thisissecret' -d '{"date":"20180915","quantity":"5"}'
{"message":"Success.","isSuccess":true}
Browse https://pixe.la/v1/users/a-know/graphs/test-graph
, again!
"Pixela" is the Pixelation API service. With this service, you can get a graph that expresses the degree of your daily various activities on a basis with a vivid gradation. Registration / deletion of user and graph definition, degree of activity etc. can all be done via API, so it can be used programmably.
This is an API for performing operations on users on Pixela. Authentication is performed by specifying a token in X-USER-TOKEN in the HTTP request header.
Create a new Pixela user.
Key | Type | Description |
---|---|---|
token | string | [not optional] A token string used to authenticate as a user to be created. The token string is hashed and saved. Validation rule: [ -~]{8,128} |
username | string | [not optional] User name for this service. Validation rule: [a-z][a-z0-9-]{1,16} |
agreeTermsOfService | string | [not optional] Specify yes or no whether you agree to the terms of service.Please see: Terms of service - Japanese version / Terms of service - English version |
notMinor | string | [not optional] Specify yes or no as to whether you are not a minor or if you are a minor and you have the parental consent of using this service. |
$ curl -X POST https://pixe.la/v1/users -d '{"token":"thisissecret", "username":"a-know", "agreeTermsOfService":"yes", "notMinor":"yes"}'
{"message":"Success.","isSuccess":true}
Updates the authentication token for the specified user.
Key | Type | Description |
---|---|---|
newToken | string | [not optional] It is a new authentication token. The token string is hashed and saved. Validation rule: [ -~]{8,128} |
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X PUT https://pixe.la/v1/users/a-know -H 'X-USER-TOKEN:thisissecret' -d '{"newToken":"thisissecret"}'
{"message":"Success.","isSuccess":true}
Deletes the specified registered user.
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X DELETE https://pixe.la/v1/users/a-know -H 'X-USER-TOKEN:thisissecret'
{"message":"Success.","isSuccess":true}
This is an API for creating, acquiring, updating and deleting pixleation graph definitions. Authentication is performed by specifying a token in X-USER-TOKEN in the HTTP request header.
Create a new pixelation graph definition.
Key | Type | Description |
---|---|---|
id | string | [not optional] It is an ID for identifying the pixelation graph. Validation rule: ^[a-z][a-z0-9-]{1,16} |
name | string | [not optional] It is the name of the pixelation graph. |
unit | string | [not optional] It is a unit of the quantity recorded in the pixelation graph. Ex. commit, kilogram, calory. |
type | string | [not optional] It is the type of quantity to be handled in the graph. Only int or float are supported. |
color | string | [not optional] Defines the display color of the pixel in the pixelation graph. shibafu , momiji , sora , ichou , ajisai and kuro are supported as color kind. |
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ 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"}'
{"message":"Success.","isSuccess":true}
Get all predefined pixelation graph definitions.
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X GET https://pixe.la/v1/users/a-know/graphs -H 'X-USER-TOKEN:thisissecret'
{"graphs":[{"id":"test-graph","name":"graph-name","unit":"commit","type":"int","color":"shibafu"}]}
Based on the registered information, express the graph in SVG format diagram.
Key | Description | |
---|---|---|
date | string | [optional] If you specify it in yyyyMMdd format, will create a pixelation graph dating back to the past with that day as the start date. If this parameter is not specified, the current date (UTC) and time will be the start date. |
$ curl -X GET https://pixe.la/v1/users/a-know/graphs/test-graph?date=20180331
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="135">
...
</svg>
Update predefined pixelation graph definitions. The items that can be updated are limited as compared with the pixelation graph definition creation.
Key | Type | Description |
---|---|---|
name | string | [not optional] It is the name of the pixelation graph. |
unit | string | [not optional] It is a unit of the quantity recorded in the pixelation graph. Ex. commit, kilogram, calory. |
color | string | [not optional] Defines the display color of the pixel in the pixelation graph. shibafu , momiji , sora , ichou , ajisai and kuro are supported as color kind. |
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X PUT https://pixe.la/v1/users/a-know/graphs/test-graph -H 'X-USER-TOKEN:thisissecret' -d '{"name":"graph-name","unit":"commit","color":"shibafu"}'
{"message":"Success.","isSuccess":true}
Delete the predefined pixelation graph definition.
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X DELETE https://pixe.la/v1/users/a-know/graphs/test-graph -H 'X-USER-TOKEN:thisissecret'
{"message":"Success.","isSuccess":true}
"Pixel" is data representing the quantity of each day. This is an API for creating, acquiring, updating and deleting Pixel in specified pixelation graph. Authentication is performed by specifying a token in X-USER-TOKEN in the HTTP request header.
It records the quantity of the specified date as a "Pixel".
Key | Type | Description |
---|---|---|
date | string | [not optional] The date on which the quantity is to be recorded. It is specified in yyyyMMdd format. |
quantity | string | [not optional] Specify the quantity to be registered on the specified date. Validation rule: int ^\-?[0-9]+ float^\-?[0-9]+\.[0-9]+ |
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X POST https://pixe.la/v1/users/a-know/graphs/test-graph -H 'X-USER-TOKEN:thisissecret' -d '{"date":"20180915","quantity":"5"}'
{"message":"Success.","isSuccess":true}
Get registered quantity as "Pixel".
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X GET https://pixe.la/v1/users/a-know/graphs/test-graph/20180915 -H 'X-USER-TOKEN:thisissecret'
{"quantity":5}
Update the quantity already registered as a "Pixel".
Key | Type | Description |
---|---|---|
name | string | [not optional] It is the name of the pixelation graph. |
quantity | string | [not optional] Specify the quantity to be registered on the specified date. Validation rule: ^\-?[0-9]+\.?[0-9]+ |
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X PUT https://pixe.la/v1/users/a-know/graphs/test-graph/20180915 -H 'X-USER-TOKEN:thisissecret' -d '{"quantity":"7"}'
{"message":"Success.","isSuccess":true}
Increment quantity "Pixel" of the day (UTC).
If the graph type is int
then 1 added, and for float
then 0.01 added.
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
Content-Length | Since the request body is not specified, specify the Content-Length header. |
$ curl -X PUT https://pixe.la/v1/users/a-know/graphs/test-graph/increment -H 'X-USER-TOKEN:thisissecret' -H 'Content-Length:0'
{"message":"Success.","isSuccess":true}
Decrement quantity "Pixel" of the day (UTC).
If the graph type is int
then -1 added, and for float
then -0.01 added.
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
Content-Length | Since the request body is not specified, specify the Content-Length header. |
$ curl -X PUT https://pixe.la/v1/users/a-know/graphs/test-graph/decrement -H 'X-USER-TOKEN:thisissecret' -H 'Content-Length:0'
{"message":"Success.","isSuccess":true}
Delete the registered "Pixel".
Key | Description |
---|---|
X-USER-TOKEN | [not optional] It is the authentication token specified at the time of user registration. |
$ curl -X DELETE https://pixe.la/v1/users/a-know/graphs/test-graph/20180915 -H 'X-USER-TOKEN:thisissecret'
{"message":"Success.","isSuccess":true}
Here are some useful ways to use Pixela. Please try incorporating Pixela in your daily life in various ways.
iOS 12 "Shortcut" is a convenient function that can also send any HTTP requests.
Create shortcuts like below for registering quantity to Pixela in advance. How about using the shortcut at the end of the day to record the quantity of your day?
(Click to view large image)
iOS 12 "Shortcut" can also access "Healthcare" metrics such as step count and mileage.
Let's make various shortcuts!
/increment
API calls into your CI / CD flowWith Pixela /increment
API, you can add quantity more and more.
By incorporating this /increment
API call into your CI / CD flow, you can easily get pixelation graph and appeal the state of the number of deployments per day.
The pixelation graph below shows an example when you record the number of deployments.
Please come up with your own way of using interesting and useful Pixela! And please tell me @a_know that!