Pixela - Pixelation API Service

"Pixel" is ! / Record, and Visualize.


Getting Started

Pixela is easy to start with 3 steps.

1. Create a user.

$ curl -X POST https://pixe.la/v1/users -d '{"token":"thisissecret", "username":"a-know", "agreeTermsOfService":"yes", "notMinor":"yes"}'
{"message":"Success.","isSuccess":true}

2. Create a graph definition.

$ 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}

3. Get the graph!

Browse https://pixe.la/v1/users/a-know/graphs/test-graph !

Getting Started

4. If you want to record quantity, ...

$ 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}

5. Browse again!

Browse https://pixe.la/v1/users/a-know/graphs/test-graph, again!

Getting Started

6. That's all! Please see here for more useful usage!


About

Lorem Ipsum"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.


APIs - User

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.

POST /v1/users

Create a new Pixela user.


PUT /v1/users/<username>

Updates the authentication token for the specified user.


DELETE /v1/users/<username>

Deletes the specified registered user.


APIs - Graph

This is an API for creating, acquiring, updating and deleting pixelation graph definitions. Authentication is performed by specifying a token in X-USER-TOKEN in the HTTP request header.

POST /v1/users/<username>/graphs

Create a new pixelation graph definition.


GET /v1/users/<username>/graphs

Get all predefined pixelation graph definitions.


GET /v1/users/<username>/graphs/<graphID>

Based on the registered information, express the graph in SVG format diagram.


PUT /v1/users/<username>/graphs/<graphID>

Update predefined pixelation graph definitions.
The items that can be updated are limited as compared with the pixelation graph definition creation.


DELETE /v1/users/<username>/graphs/<graphID>

Delete the predefined pixelation graph definition.


APIs - Pixel

"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.

POST /v1/users/<username>/graphs/<graphID>

It records the quantity of the specified date as a "Pixel".


GET /v1/users/<username>/graphs/<graphID>/<yyyyMMdd>

Get registered quantity as "Pixel".


PUT /v1/users/<username>/graphs/<graphID>/<yyyyMMdd>

Update the quantity already registered as a "Pixel".


PUT /v1/users/<username>/graphs/<graphID>/increment

Increment quantity "Pixel" of the day (UTC).
If the graph type is int then 1 added, and for float then 0.01 added.


PUT /v1/users/<username>/graphs/<graphID>/decrement

Decrement quantity "Pixel" of the day (UTC).
If the graph type is int then -1 added, and for float then -0.01 added.




Useful Usage

Here are some useful ways to use Pixela. Please try incorporating Pixela in your daily life in various ways.

ex.1 Simply embed in your website

GET /v1/users/<username>/graphs/<graphID> returns SVG rawdata.
By specifying this API in HTML img tag like <img src="https://pixe.la/v1/users/<a-know>/graphs/<example-graph>">, you can easily display the graph.


ex.2 Record from iOS 12 "Shortcut"

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 full image)


iOS 12 "Shortcut" can also access "Healthcare" metrics such as step count and mileage.
Let's make various shortcuts!


ex.3 Incorporate /increment API calls into your CI / CD flow

With 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.


ex.4 Use with third party libraries

Pixela Users make libraries for convenient use of Pixela, so I will introduce them here. Thank you very much!!
If you create a new one, please contact @a_know.

Third Party Libraries - a-know/Pixela Wiki


And more...

Please come up with your own way of using interesting and useful Pixela! And please tell me @a_know that!