Post value to the graph

Call /v1/users/<username>/graphs/<graphID> by HTTP POST.

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
date string [required] The date on which the quantity is to be recorded. It is specified in yyyyMMdd format.
quantity string [required] Specify the quantity to be registered on the specified date.Validation rule: int^-?[0-9]+ float^-?[0-9]+.[0-9]+
optionalData string [optional] Additional information other than quantity. It is specified as JSON string.The amount of this data must be less than 10 KB.
post_endpoint = f"{pixela_endpoint}/{USERNAME}/graphs/{GRAPH_ID}"

pixel_params = {
    "date": "20220116",
    "quantity": "60",
}

response = requests.post(url=post_endpoint, json=pixel_params, headers=headers)
print(response.text)