Description
Update the quantity already registered as a "Pixel". If target "Pixel" not exist, create a new "Pixel" and set quantity.
HTTP Method , API endpoint
PUT /v1/users/<username>/graphs/<graphID>/<yyyyMMdd>
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 |
---|---|---|
quantity | string | [optional] 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. |
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.
413 Payload Too Large
- This is an error if your request is larger than the limit defined by the Pixela specification. Unless you correct it, the request will not be 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.- You can avoid this rejection by becoming a Pixela supporter. See this page for more information.
Example
$ curl -X PUT https://pixe.la/v1/users/a-know/graphs/test-graph/20180915 -H 'X-USER-TOKEN:thisissecret' -d '{"quantity":"7","optionalData":"{\"key\":\"value\"}"}' {"message":"Success.","isSuccess":true}