Pixela API Document

API Document for Pixela ( https://pixe.la/ ) .

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

Description

Get a Date list of Pixel registered in the graph specified by graphID.
You can specify a period with from and to parameters.

  • If you do not specify both from andto;
    • You will get a list of 365 days ago from today.
  • If you specify from only;
    • You will get a list of 365 days from from date.
  • If you specify to only;
    • You will get a list of 365 days ago from to date.
  • If you specify both from andto;
    • You will get a list you specify.
    • You can not specify a period greater than 365 days.

Help page

Graph - Pixela Help Center

HTTP Method , API endpoint

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

Request Header

Key Description
X-USER-TOKEN [required] It is the authentication token specified at the time of user registration.

Query Parameter

Key Type Description
from string [optional] Specify the start position of the period.
to string [optional] Specify the end position of the period.
withBody boolean [optional] ​If you specify true for this parameter, you can also get all the information the Pixel has.

Possible errors by HTTP response status code

  • 400 Bad Request
    • This is an error if there is some mistake in your request. Unless the mistake is corrected, the request will not succeed.
  • 404 Not Found
    • This error occurs when your request destination does not exist.
    • This error also occurs when authentication to the request destination is not successful.
  • 500 Internal Server Error
    • Status in the event of an unexpected error. Retrying the request may be successfully processed.
  • 503 Service Unavailable
    • This error occurs when Pixela is temporarily unavailable. Please take a moment and retry your request.
    • If the response body contains "isRejected":true, it indicates that the request was rejected 25% of the time. In this case, the request can be retried until it succeeds.

Example

$ curl -X GET "https://pixe.la/v1/users/a-know/graphs/test-graph/pixels?from=20180101&to=20181231" -H 'X-USER-TOKEN:thisissecret'
{"pixels":["20180101","20180505","20181204"]}
$ curl -X GET "https://pixe.la/v1/users/a-know/graphs/test-graph/pixels?withBody=true&from=20180101&to=20181231" -H 'X-USER-TOKEN:thisissecret'
{"pixels":[{"date":"20180101","quantity":"5"},{"date":"20180505","quantity":"1","optionalData":"{\"key\":\"value\"}"},{"date":"20181204","quantity":"8"}]}