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
Jimmacle
Jimmacle6d ago
$details
MODiX
MODiX6d ago
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)
Jimmacle
Jimmacle6d ago
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
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
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
Jimmacle
Jimmacle6d ago
then the others are doing something wrong nothing in C# itself will prevent you from sending well formed HTTP requests
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
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?
Jimmacle
Jimmacle6d ago
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
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
No the c# code works fine, it’s the request itself that the json returns “Forbidden”
Jimmacle
Jimmacle6d ago
so the C# code doesn't work fine...
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
That’s what I thought
Jimmacle
Jimmacle6d ago
you're probably not setting the authorization header correctly or at all
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
It doesn’t require one
Jimmacle
Jimmacle6d ago
it pretty clearly does if it's telling you you're not authorized to access the endpoint
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
That’s why I’m saying you can just go to the api website in your browser
Jimmacle
Jimmacle6d ago
does the API have an IP whitelist?
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
Well I can run it in my browser and it works for me with no authorization The code works for me Nope
Jimmacle
Jimmacle6d ago
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
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
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
Jimmacle
Jimmacle6d ago
and this is?
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
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
Jimmacle
Jimmacle6d ago
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
Jimmacle
Jimmacle6d ago
RecRoom - developer portal
APIs: List
Discover APIs, learn how to use them, try them out interactively, and sign up to acquire keys.
Jimmacle
Jimmacle6d ago
"sign up to acquire keys" implies you should be sending authenticated requests
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
Oh maybe they have updated it But you are able to access it though the link I sent within your browser without one?
Jimmacle
Jimmacle6d ago
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
Nick Eh Likes 15
Nick Eh Likes 15OP6d ago
i mean its pulled from the website so i dont see why i wouldnt be allowed
Jimmacle
Jimmacle6d ago
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
Nick Eh Likes 15
Nick Eh Likes 15OP5d ago
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.
Nick Eh Likes 15
Nick Eh Likes 15OP5d ago
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.

Did you find this page helpful?