Pixela API Document

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

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

Description

Create a notification rule.
You must be a Pixela supporter to create multiple notifications. see: How to support Pixela by Patreon / Use Limited Features · a-know/Pixela Wiki · GitHub

HTTP Method , API endpoint

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

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 notification settings.
Validation rule: ^[a-z][a-z0-9-]{1,16}
name string [required] It is the name of the notification settings.
target string [required] Specify the target to be notified.
Only quantity is supported.
condition string [required] Specify the condition used to judge whether to notify or not.
>, =, <, and multipleOf are available.
You must be a Pixela supporter to specify multipleOf condition. see: How to support Pixela by Patreon / Use Limited Features · a-know/Pixela Wiki · GitHub
threshold string [required] Specify the threshold value for deciding whether to notify or not. The number must match the graph type(int or float).
channelID string [required] Specify the ID of the channel to be notified.

Example

$ curl -X POST https://pixe.la/v1/users/a-know/graphs/test-graph/notifications -H 'X-USER-TOKEN:thisissecret' -d '{"id":"my-notification-rule","name":"my notification rule","target":"quantity","condition":">","threshold":"5","channelID":"my-channel"}'
{"message":"Success.","isSuccess":true}