tumblr / docs

Tumblr's public platform documentation.
Apache License 2.0
109 stars 27 forks source link

Block api routes disabled/broken? #95

Closed HartleyAHartley closed 1 year ago

HartleyAHartley commented 1 year ago

When posting to https://api.tumblr.com/v2/blog/<blog_name>/blocks/bulk?blocked_tumblelogs=<blog_here>. I receive: { 'meta': {'status': 400, 'msg': 'Bad Request'}, 'response': [], 'errors': [{'title': 'Bad Request', 'code': 5008, 'detail': ''}]} I expect: To receive a 200 OK.

When posting to 'https://api.tumblr.com/v2/blog/<blog_name>/blocks?blocked_tumblelog=<blog_here>' I receive: {'meta': {'status': 404, 'msg': 'Not Found'}, 'response': [], 'errors': [{'title': 'Not Found', 'code': 0, 'detail': 'Hit a snag. Try again.'}]} I expect: To receive a 201 Created.

My expectations are according to the current existing api documentation. Are the block routes currently not functional, shutdown, or is it user error.

marcustyphoon commented 1 year ago

Looks like the bulk endpoint uses blocked_tumblelogs and the single one uses blocked_tumblelog, but you're using the singular word on the plural endpoint; is that it?

cyle commented 1 year ago

Looks like the bulk endpoint uses blocked_tumblelogs and the single one uses blocked_tumblelog, but you're using the singular word on the plural endpoint; is that it?

this is likely the issue -- the bulk endpoint's expected POST body param (not a query string param) is blocked_tumblelogs, plural.

HartleyAHartley commented 1 year ago

No that's just a typo in my issue. In my testing it was properly blocked_tumblelogs

Fixed Typo.

nightpool commented 1 year ago

@HartleyAHartley The more important point that @marcustyphoon made is that your block request needs to be a POST request, with a body. you can't use query parameters, those are for GET request

HartleyAHartley commented 1 year ago

Ah that makes sense. Thanks the api docs confused me.