Bug in member profile end point - Resolved.

Sort:
Tricky_Dicky

https://api.chess.com/pub/player/ElenaStamataki

Web page shows location as "England"  https://www.chess.com/member/ElenaStamataki

API end point does not include "location" data

 

stephen_33

That's curious because when I check my own endpoint I see the correct location. But I don't when I look at a friend's data...

https://api.chess.com/pub/player/proximo

{"avatar":"https://images.chesscomfiles.com/uploads/v1/user/6681776.6a383d7a.200x200o.6d9691519153.jpeg","player_id":6681776,"@id":"https://api.chess.com/pub/player/proximo","url":"https://www.chess.com/member/Proximo","name":"DW","username":"proximo","followers":192,"country":"https://api.chess.com/pub/country/NL","last_online":1564040093,"joined":1329435866,"status":"premium","is_streamer":false}
stephen_33

Is it because 'location' is not the same as 'country'? I have my country/flag set as Wales but I also identify my location as 'Swansea', my home town. Those members who leave their location fields blank presumably give a null return for that in their endpoints?

skelos

The "location" field is whatever the member has set for their country. @proximo does't appear to have set that. He has set his name:

"name":"DW"

For @TrickyDicky's user, they've a country set (I think you have to have, even if it's "International" which will be country "XX") but the county is England ("XE", since chess.com give the option, otherwise would have to be "UK").

 

IMHO, no bug, just data not present in those users' profiles.

Tricky_Dicky
stephen_33 wrote:

Is it because 'location' is not the same as 'country'? I have my country/flag set as Wales but I also identify my location as 'Swansea', my home town. Those members who leave their location fields blank presumably give a null return for that in their endpoints?

Stephen in your Location do you include Wales or is it just Swansea?

It looks as though Giles may be right. Not a bug. C.C code seems to auto adds the country based on flag to location but this isn't present in user location field.

tortoises3

You can change your country flag and location through profile settings. Someone could say they're from Tokyo, Japan when in reality they could be in Greenland.

skelos
Tricky_Dicky wrote:
stephen_33 wrote:

Is it because 'location' is not the same as 'country'? I have my country/flag set as Wales but I also identify my location as 'Swansea', my home town. Those members who leave their location fields blank presumably give a null return for that in their endpoints?

Stephen in your Location do you include Wales or is it just Swansea?

It looks as though Giles may be right. Not a bug. C.C code seems to auto adds the country based on flag to location but this isn't present in user location field.

I know I wasn't asked, by for my location I entered only "Melbourne". Australia shows up because that's the country I set (I assume). I certainly didn't type it in.

Tricky_Dicky

Thanks Giles. Yes looks to be that C.C adds flag name to location on profile page. No bugs here.

 

stephen_33
Tricky_Dicky wrote:
stephen_33 wrote:

Is it because 'location' is not the same as 'country'? I have my country/flag set as Wales but I also identify my location as 'Swansea', my home town. Those members who leave their location fields blank presumably give a null return for that in their endpoints?

Stephen in your Location do you include Wales or is it just Swansea?

It looks as though Giles may be right. Not a bug. C.C code seems to auto adds the country based on flag to location but this isn't present in user location field.

This is what I see on my settings page:-

..so I imagine that if the location field is left blank, no data for "location" is returned in the endpoint. A little like a member's avatar, if the default is used then "avatar" is absent in the endpoint.

Tricky_Dicky

Yes. Logical. Thanks Stephen.