Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
Can't find any way to get POST requests working Reddit API - 403 Error

I'm trying to build a reddit-like app on react native, so i'm using axios to fetch requests to Reddit Api and I can't seem to be able to fetch any POST requests, I've tried everything I can, I'm trying to subscribe to a subreddit, here is my request :

subscribe: async function subscribe(action, sub, modhash) {
       try {
    const token = await this.getAccessToken();
    console.log('token: ' + token)
    let Headers = {'Authorization': 'Bearer ' + token,
      'Content-Type': 'application/json',
      'X-Modhash': modhash}
    let Params =  {'action': action, 'sr_name': sub}
    let Body = {'api_type': "json", "extension": "json"}
    await axios.post('https://oauth.reddit.com/api/subscribe', Headers, Params, Body)
    .then((response) => {
      console.log('sub: ' + JSON.stringify(response.data));
      console.log("Subbed to " + sub)
    })
  } catch (error) {
    throw 'Could not sub: ' + error
  }
},

Here is the Catch result:

"Could not sub: Error: Request failed with status code 403"

here is the official api about subscribe : https://www.reddit.com/dev/api/#POST_api_subscribe

action = "sub" and sr = "t5_2qh03" and I tried sr_name and sr but none seems to work, I'm sure the token is valid since it works with other GET requets I can't find what I did wrong here. Do you guys have any idea on what I'm missing ?

Edit: I've tried the same request with postman and the request actually worked, i did sub to a subreddit, but the same exact request is not working with axios, does my request is okay ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To me, your code is alright.

However, the Reddit API is such a clusterfuck, that peoples are not much using it.

They are using pupeeter and similar.

For your problem, it all depends of the subreddit, some (many) are not allowing to POST by API at all, of course without warning, or with totally unclear HTTP error codes It just doesn't work.

There is also situations where it works, but only sometimes, or only the first time, or only from an IP of a given allowed country.

They are also widely using black/grey/white listing, shadow banning, and rate limiting. But no notices are ever given. The definition of a clusterfuck.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!