A few users were reporting that some posts in my app lacked any thumbnails, despite them having it turned on in their Reddit prefs. I investigated, and sure enough the JSON for that post that is returned through the API lacks any thumbnails, whereas most posts include them.
Here's the post. Note: post is a NSFW pic of Selena Gomez in a bikini. It's a post a user reported to me and replicates it well rather than trying to find another post that has this behavior.
https://www.reddit.com/r/SelenaGomez/comments/bjx1br/perfection/
Here's the JSON where you can see there's no thumbnails: https://www.reddit.com/r/SelenaGomez/comments/bjx1br/perfection/.json?raw_json=1
Here's a post that would have thumbnails for instance (under previews
): https://www.reddit.com/r/pics/comments/bmb555/love_the_color_contrast_in_this_image/.json?raw_json=1
I investigated with the official Reddit app and monitored its network traffic with Charles. It made a request to the same endpoint but the response JSON does have thumbnails.
The endpoint they hit is as follows (note the extra URL parameters): https://oauth.reddit.com/r/SelenaGomez/comments/bjx1br/perfection/.json?always_show_media=1&api_type=json&background_fetch=0&expand_srs=1&feature=link_preview&from_detail=1&include_categories=true&obey_over18=1&raw_json=1&request_timestamp=772465195&rtj=debug&sort=top&sr_detail=1&threaded=false&truncate=8
- Both tests were done on the same account to the exact same URL (the one above with the extra parameters). I replicated the tests with
cURL
to the exact same endpoint. The only differences I made were theAuthorization
header which had different access tokens, one for my app, and one for the official app. - The account in my app has all the authorization scopes currently available at
/api/v1/scopes
. I count 28 that my app requests.
Here is the JSON returned when I use my token: https://gist.github.com/christianselig/7f704809e6d7d7b052dab0d6a12fea6f
Here is the JSON when I use the Reddit app's token: https://gist.github.com/christianselig/575d401247d463ca719a13212d424e50
Note that I'm not insinuating some massive conspiracy, I'm just curious if this is a bug, or if there's something I'm doing wrong that can be easily remedied, or if I'm just straight up doing something silly. Is it possible there's an extra scope that isn't public or something that allows access to this?
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...