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

Update Shield Mode Status - Incorrect PUT Body and Headers in Documentation #698

Closed
gmt2001 opened this issue Dec 3, 2022 · 3 comments
Closed
Labels
done The bug or issue has been addressed product: docs Documentation on dev.twitch.tv/docs

Comments

@gmt2001
Copy link

gmt2001 commented Dec 3, 2022

Brief description
The PUT body and headers in the documentation for Update Shield Mode Status is incorrect

Incorrect documentation

curl -X PUT 'https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765' \
-H 'Authorization: Bearer kpvy3cjboypmiacwr0c19hotn5s' \
-H 'Client-Id: hof5gwx0su6owfn0yan9c87zr6t' \
-H 'Client-Type: application/json' \
-d '{"data":{"is_active":false}}'

Expected documentation

curl -X PUT 'https://api.twitch.tv/helix/moderation/shield_mode?broadcaster_id=12345&moderator_id=98765' \
-H 'Authorization: Bearer kpvy3cjboypmiacwr0c19hotn5s' \
-H 'Client-Id: hof5gwx0su6owfn0yan9c87zr6t' \
-H 'Content-Type: application/json' \
-d '{"is_active":false}'

Screenshots
image

Additional Observation
The endpoint will return 200 OK and the body showing the current state (before the attempted state change) of Shield Mode if using the incorrect body defined in the documentation.

I would expect this to return 400 Bad Request

@gmt2001 gmt2001 added the product: docs Documentation on dev.twitch.tv/docs label Dec 3, 2022
@iProdigy
Copy link

iProdigy commented Dec 3, 2022

I'm able to reproduce the endpoint not doing anything if the body follows the documentation (i.e., {"is_active": true} is correct).

Also, to get the endpoint to work, Content-Type header needs to be present (docs mistakenly do Client-Type)

@gmt2001
Copy link
Author

gmt2001 commented Dec 3, 2022

Also, to get the endpoint to work, Content-Type header needs to be present (docs mistakenly do Client-Type)

Good catch, didn't notice since I was using my bot lib which already did that. Updating OP and forums post

@gmt2001 gmt2001 changed the title Update Shield Mode Status - Incorrect PUT Body in Documentation Update Shield Mode Status - Incorrect PUT Body and Headers in Documentation Dec 3, 2022
@scott-a-white
Copy link

Thanks for letting us know about the issues. The fix will go out in the next doc release.

@Xemdo Xemdo closed this as completed Aug 9, 2023
@Xemdo Xemdo added the done The bug or issue has been addressed label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done The bug or issue has been addressed product: docs Documentation on dev.twitch.tv/docs
Projects
None yet
Development

No branches or pull requests

4 participants