API request issue
So to me, this is strange for me I can run the code perfectly fine but when other people run the code the api request gets “Forbidden” Is there some kind of special way C sharp gets request that could be preventing this?
29 Replies
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
but if the API is giving you a 403, that means you either aren't sending credentials (which should be a 401 but you never know) or the credentials you're sending do not give you access to the resource you're requesting
But this is my issue it works perfectly fine for me, and every value important value is fixed
Okay I’ll paste it later not home rn
then the others are doing something wrong
nothing in C# itself will prevent you from sending well formed HTTP requests
That’s what I thought, it works perfectly fine when you do it in your browser
Is there anyway to see more information?
Or like run it in a browser
Also could the app not having admin effect it?
so does the C# code work inconsistently or not at all?
does the C# code work when you run it?
or are you only using a browser?
running as admin on your local machine has nothing to do with API authentication
No the c# code works fine, it’s the request itself that the json returns “Forbidden”
so the C# code doesn't work fine...
That’s what I thought
you're probably not setting the authorization header correctly or at all
It doesn’t require one
it pretty clearly does if it's telling you you're not authorized to access the endpoint
That’s why I’m saying you can just go to the api website in your browser
does the API have an IP whitelist?
Well I can run it in my browser and it works for me with no authorization
The code works for me
Nope
i don't know exactly what you're doing when you do this so that doesn't help me
the API website isn't the API
assuming you're referring to some complex web page and you aren't just pasting an API endpoint into your browser
GitHub
Release AETool Scraper v1.1.0 · nichehlikes15/ae-2018-2022
Added a setting to remove junior accounts from being scraped
Fixed api when scraping being denied
and this is?
A example of the api request https://accounts.rec.net/account/bulk?id=1999843
It’s just a scraper that gets all the username in a game
Nothing much
Just uses api
It’s around like 500 where the error shows and I think 600-700 where the request is sent
you'll have to refer to their API documentation for requirements to send a proper request
it doesn't look like you're actually using their official API which is going to cause issues
RecRoom - developer portal
APIs: List
Discover APIs, learn how to use them, try them out interactively, and sign up to acquire keys.
"sign up to acquire keys" implies you should be sending authenticated requests
Oh maybe they have updated it
But you are able to access it though the link I sent within your browser without one?
what you gave me is not an official API endpoint
you should be using their actual API, it's not clear if you're allowed to use what you're trying to use
i mean its pulled from the website
so i dont see why i wouldnt be allowed
just because you can access it doesn't mean you're allowed to use it the way you're using it
if they have an official API the implication is that you shouldn't be using random undocumented endpoints
will do thank you
oh @Jimmacle one more thing, this is real random but only people on windows 10 are having this issue. Some other friends are on windows 11 and its working fine.
This doesnt make sense to me and this would impact using the https://devportal.rec.net/apis as well any idea why?
RecRoom - developer portal
APIs: List
Discover APIs, learn how to use them, try them out interactively, and sign up to acquire keys.