Using discord API on an esp32

I'm trying to use the discord API to get messages and display them on an lcd screen but every time I send a get request I get a 401 unauthorized code and I couldn't figure out how to do it at first, but after some research I found the way on how you do it and turns out that you need to pass to parameters if you want to post a message: 1-data(content) 2- headers(authorization token). But, that is on python and I believe that is how you do it for every get(but without the data, just the authorization token) or post request. I also tried doing this :

http.addHeader("Content-Type", "application/json");
int httpCode = http.GET("{\"authorization\" : \"{my token}\"}");

I think it is just passing that as a data not as a header, if anyone knows how to pass a header let me know.

No, 'authorization' is a header field that you need to use. According to the docs here. You also need to include what type of token you are passing - bot or bearer. You also need to provide a valid user agent.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.