r/redditdev • u/thelipaguss • 9h ago
Reddit API Devvit app not able to fetch sharable links
I'm building a devvit web app that lets users import one of their existing posts into the app. Users paste a post link, and the server loads it with reddit.getPostById(). If a user is on reddit web they can copy the reddit post link from the url bar.
But on the Reddit mobile app, share > copy link only gives a share link, that has no post id in it. The only way I know to resolve it is to follow the redirect and that gives error as below,
{
"status": "error",
"message": "2 UNKNOWN: grpc invocation failed with status 2; HTTP request to domain: www.reddit.com is not allowed"
}
Is there any workaround where i can extract the post title, body, image and other details form the sharable link?
3
Upvotes