Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apidocs misleading - causes API requests to /user/allocate always up Strength #10557

Closed
SabreCat opened this issue Jul 26, 2018 · 3 comments · Fixed by #10592
Closed

apidocs misleading - causes API requests to /user/allocate always up Strength #10557

SabreCat opened this issue Jul 26, 2018 · 3 comments · Fixed by #10592

Comments

@SabreCat
Copy link
Member

Description

The data payload of a curl request to /api/v3/user/allocate appears not to be parsed correctly, leading to the default STR attribute being incremented regardless of the request. For instance, the following returns success but bumps STR instead of the desired INT:

curl -s -X POST --compressed -H "Content-Type:application/json" -H "x-api-user:USERID" -H "x-api-key:API_TOKEN" https://habitica.com/api/v3/user/allocate -d '{"stat": "int"}'

@TheHollidayInn
Copy link
Contributor

That's because stats is supposed to be a query param. We document that:

I can see how this could be confusing, but it isn't a bug.

@Alys Alys changed the title API requests to /user/allocate always up Strength apidocs misleading - causes API requests to /user/allocate always up Strength Aug 11, 2018
@Alys
Copy link
Contributor

Alys commented Aug 11, 2018

The apidocs for that route have it listed under the heading "Body Parameters", which is probably how the confusion arises (even though it's "query parameters" in the text).

I'm reopening this for the docs to be clarified but I"m assigning it to myself to fix because I want to make a couple of other wording changes too (e.g., "Stat Points")

@Alys Alys reopened this Aug 11, 2018
@Alys Alys self-assigned this Aug 11, 2018
@TheHollidayInn
Copy link
Contributor

Ah I guess that's because of the body after param. I saw the query param next to the name on the doc line.

paglias pushed a commit that referenced this issue Aug 12, 2018
…ixes #10557 (#10592)

* correct curl parameter (-X for request method; -x for proxy information)

* fix typo in error message

* fix mistakes in apidocs for allocating Stat Points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants