Pixela API Document

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

PUT - /v1/users/<username>/graphs/<graphID>/notifications/<notificationID>

Description

Update predefined notification rule.

HTTP Method , API endpoint

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

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
name string [optional] It is the name of the notification settings.
target string [optional] Specify the target to be notified.
Only quantity is supported.
condition string [optional] 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 [optional] Specify the threshold value for deciding whether to notify or not. The number must match the graph type(int or float).
remindBy string [optional]
The number from 0 to 23 is specified as a string. This represents the time of day. If a number is specified for this property, the following operations will be performed automatically every day at the time of the number of this property.

- Check the quantity of pixel for that day on the graph from which this notification is related.
- If the check result does not satisfy the conditions ( condition , threshold ) of this notification rule, a notification will be sent.

The time zone set in the graph is used to perform this process. You can also set this item to an empty strings ("") if you don't want this process.
channelID string [optional] Specify the ID of the channel to be notified.

Example

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