No response code in team matches request

Sort:
Tricky_Dicky

I have come across two instances of team matches requests that should return "not found" error.

https://api.chess.com/pub/club/team-méxico/matches

https://api.chess.com/pub/club/team-trentino-südtirol/matches

These calls do not return any responce at all. Just a blank page.

Probably relates to extended character set chars.

stephen_33

I'm seeing this response when I try to open the page in my browser:-

This api.chess.com page can’t be found

It may have been moved or deleted.

HTTP ERROR 410
stephen_33

Can't remember encountering that error before so I did some searching...

https://www.exai.com/blog/410-gone-client-error


".... the 4xx status codes are client errors. Meaning, something that is happening on the client-side of things is the issue. It might be unauthorized access, a mistake in the request, or an incorrect data format.

The HTTP Status Code 410 Gone is similar to the 404 error, but it's more straightforward. In a sense, it's a more permanent version of 404. How is that? The 404 error means that the page you wanted to access on a website is not currently found on the server, but it could be found in the future. In the case of a 410 error, the resource is truly gone, and you won't be able to access it in the future. It's no longer available on the server, and no redirect was used to lead the user to another page.

When Google encounters a 410 error code, it processes it as a message from the Webmaster that says: Hey, this page is really gone and is not coming back."

Some webmasters prefer using the 410 HTTP status code over 404 to explicitly tell Google that they've permanently removed a page from a site. Consequently, Google will stop crawling the page. On the other hand, many webmasters don't recommend using a 410 status code and suggest better alternatives like a no-index tag"

Tricky_Dicky

In Firefox I don't get anything. Just a blank page. This is also what is returned by my XML 6.0 call from Excel/VBA.

Just tried in Chrome and got the same as you Stephen

I was expecting this response

https://api.chess.com/pub/club/euregio-lille/matches

{"code":0,"message":"Club \"euregio-lille\" not found."}


Tricky_Dicky

I think this began after the changes (and errors) for the team match number restrictions was introduced.

stephen_33

Those two clubs (in #1) have been deleted and all reference removed I take it? At least I get error 500 when I try to open their home pages.

The question is, why is the site choosing to return a 410 error instead of the more familiar 404?

Tricky_Dicky

Not quite. Those are the web page team names using the native language. The web address is a variation on the team name without using extended character set.

https://www.chess.com/club/team-trentino-sudtirol

In the first instance I use the published team name i.e Team Trentino-Südtirol

and create an API address for the matches. If it doesn't exist I have to find the actual page.

But not getting any response code at all just stops the code. It looks as though the response is different depending on the client which is not cool.

Tournamentix

@Tricky_Dicky: Probably the club names aren't correct. These are the links to both of the clubs:

https://www.chess.com/club/team-mexico-1

https://www.chess.com/club/team-trentino-sudtirol

 

Tournamentix

Part II: There has been a modification some days ago.

As the é in the name of Team México wasn't correctly shown some months ago, they have renamed the club without the accept, have gotten a new URL (team-mexico-1) and have readded the accept, which is shown correctly since then ...

I've just created a club names The Rheinländer, which got automatically the simplified URL https://www.chess.com/club/die-rheinlander .

By the way: If I've understood it right, it isn't possible anymore to create clubs with already existing names ...

Tricky_Dicky

Yes, thanks, I know that. There is a difference between the club name (in native language which includes extended character set) and the web page address and the API address.

The issue is the error code that is returned, not the address.

stephen_33
Tricky_Dicky wrote:

Not quite. Those are the web page team names using the native language. The web address is a variation on the team name without using extended character set.

https://www.chess.com/club/team-trentino-sudtirol

In the first instance I use the published team name i.e Team Trentino-Südtirol

and create an API address for the matches. If it doesn't exist I have to find the actual page.

But not getting any response code at all just stops the code. It looks as though the response is different depending on the client which is not cool.

Yes of course, I should have spotted that because I had the same problem a few years ago. Team México has the url-id of 'team-mexico-1', so the corresponding endpoint url for the club's profile info' and admins is:-

https://api.chess.com/pub/club/team-mexico-1

That correctly returns the endpoint.

Converting club names into their equivalent url forms is problematic, not merely if the name contains characters of an extended character set. In fact you only have to create a club with a name very similar to one that exists already - for example:-

Chess Dream Team !  www.chess.com/club/chess-dream-team

Chess Dream Team  www.chess.com/club/chess-dream-team-1

It's possible to infer the first of those by using a simple translation algorithm but not the second. The only solution possible that I know of is to use a look-up table and that's what I've been doing for some time. It works well for me and when I come across what you might call an irregular club name, I simply add it to my file of 'look-ups' along with it's url-id.

That way I hardly ever get any error responses at all.

I agree with you that it's troubling to receive no response whatsoever from the site's servers, thereby crashing your program (or making it hang in effect) but then you are providing an incorrect/invalid endpoint address? If you can identify those club names likely to need special conversion, you should be able to avoid much of the problem.