#server responds with 400 or 403
54 messages · Page 1 of 1 (latest)
it's a permissions issue
how can I fix it? is there any library that will help me bypass?
no
so its their fault?
probably not
the token you gave isn't allowed to access whatever api you tried to use
either fix that externally (did you set permissions correctly?) or just.. don't use apis you can't access
it's like you're trying to send a message in an announcement channel that's locked to moderators
you can't bypass that
as for 400, that indicates the format/content of your message is invalid
check your data, and check how you're passing it
make sure you're using the body if it wants the body, or params if it wants params, and make sure you're setting the appropriate headers if necessary (some clients may set them automatically)
bruh
oof
wait i might be using params when it expects body
nah its correct format rip
one question, do I set permissions?
I just enter credentials and they give jwt
depends on the service
if it's something like discord you could have access to perms, for example
maybe link to the docs
u want link?
yeah
yeah that definitely expects a body, not params
the Content-Type header indicates the format of the body, it shows a json body in the example, and the data is structured
well i did put the object in body lol
but its js object i didnt serialize it
axios converts it into json by itself right?
chat am I cooked? XD
i haven't used axios in so long lol
ah ive been misreading the code a bit
you included a lot more context than necessary so ive been reading the earlier request since im on mobile
what's requestData?
json object provided in docs
this
according to docs i need to send this data in body, and also token in Bearer header
I think I need to contact them and ask if they messed up permissions
code is correct because its pretty simple one
i pasted same json into postman and it fails too
the example payload doesn't always work
if you're getting 403s with that then the example has stuff that you'd need to change for your own usecase
well since its 403 it has no problems with body, but the permissions so I guess it workes ;-;
can it be reason that im using localhost?
maybe their server blocks every request from http
or it doesnt matters?
403 doesn't necessarily mean that. depending on how the serverside logic is written, it might just be overshadowing a 400 because it's checked first
well, that could be possible, but that wouldn't be a 403.