Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

285
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda