a-know / Pixela

A service for generating GitHub-like graphs. Record and Track your habits or effort. All by API.
https://pixe.la
402 stars 26 forks source link

“POST /v1/users/<username>/webhooks” returns “webhookHash” instead of “hashString” #3

Closed kakkun61 closed 6 years ago

kakkun61 commented 6 years ago

The document (https://pixe.la/) says “POST /v1/users/<username>/webhooks” returns following.

{"hashString":"<WebhookHashString>","message":"Success.","isSuccess":true}

But it actually looks like following.

{"webhookHash":"<WebhookHashString>","message":"Success.","isSuccess":true}

Which is correct?

a-know commented 6 years ago

Thank you for feedback!

Probably, I think that it is a careless mistake at documentation! I will check and respond later! Thank you!

sue445 commented 6 years ago

BTW, POST /v1/users/<username>/webhooks returns webhookHash. But /v1/users/<username>/webhooks returns hashString 🤔

$ curl -s -X POST -H 'User-Agent: Pixela v0.5.1 (https://github.com/sue445/pixela)' -H 'X-USER-TOKEN:XXXXXXXXXXXXX' -H 'Content-Type: application/json' -d '{"graphID":"test-graph2","type":"increment"}' "https://pixe.la/v1/users/sue445/webhooks" | jq .
{
  "message": "Success.",
  "isSuccess": true,
  "webhookHash": "a28cc33ffd0720f42bde5d122a1f4fcaa0177a0d73f8fe69eac6833ca9591ac0"
}

$ curl -s -X GET -H 'User-Agent: Pixela v0.5.1 (https://github.com/sue445/pixela)' -H 'X-USER-TOKEN: XXXXXXXXXXXXX' -H 'Content-Type: application/json' "https://pixe.la/v1/users/sue445/webhooks" | jq .
{
  "webhooks": [
    {
      "hashString": "9e64dcda6c19e9eb7644887722a1e96d0f7247c2355a0faec07a5f9f6ee5bf40",
      "graphID": "test-graph2",
      "type": "increment"
    },
    {
      "hashString": "a28cc33ffd0720f42bde5d122a1f4fcaa0177a0d73f8fe69eac6833ca9591ac0",
      "graphID": "test-graph2",
      "type": "increment"
    }
  ]
}

I think it would be better to unify either webhookHash or hashString

a-know commented 6 years ago

Oh... 😨 Thank you for comment. Later I will unify it and inform. Thanks!!

a-know commented 6 years ago

I released v1.3.3, modified the pointed out, and cut out the API document as a another site https://docs.pixe.la/ !

As for the GET /v1/users/<username>/webhooks, it became a form including breaking change. I'm sorry but please be careful.

Thank you for telling me this, and your continuous support!