What's problem you are encountering?
im trying to make a project to show how much messages you have on scratch, i dont know how to do that What have you tried that didn't work?
i tried the website used in wit web browser ( like from https://api.allorigins.win/raw?url= )
but it always reported 0 even if the user does not exist Post a project example, link, or screenshot:
project link: Snap! 6.9.2 Build Your Own Blocks
copied text (api thing):
{"count":0}
copied text (real thing):
{"code":"ResourceNotFound","message":"/users/erererereeeeeeeeeeeeeeeeeeeee/messages/count does not exist"}
(edit: someones custom blocks helped me)
Not a solution, but I noticed there was a bit of code that could be made easier. It's the URL [ cors-anywhere.com] block script. Here is a simpler way:
The Scratch message count API returns {"count": 0} when a user with user agents related to automated scripts (like ones starting with "python-" or "curl") visits it.
if you don't know already, you have to go to https://cors-anywhere.herokuapp.com/corsdemo and then click on "Request temporary access to the demo server" before you can use cors-anywhere. I think that may be your problem.
Here is a Scratch Wiki I made (yes, I made it) explaining how to hack Scratch's cloud variables in Python. Not that I'm telling you to actually follow the tutorial. I just mean something like this is considered an automated script and so if Scratch API detects that, it will return 0. Link: How to Access the Scratch API Using Python 3 - Scratch Wiki
Does that include users that aren't the (I don't know what words to put here)? For example, if someone with an automated script goes to, say, https://api.scratch.mit.edu/users/WarpedWartWars/messages/count, would that say {"count":0} forever?
Did you happen to receive those two messages recently when you checked? Because the API takes a while to update. That is why even after you look at the message it still shows that you haven't.