Create challenges via URL?

Sort:
BaronVonChickenpants

Hi there, 

I appreciate this isn't the ideal place to put this question, but the searches I was running led me here and I think if anyone knows the people here will.

I'm trying to set up a small in-club ladder and would like to make it easy to challenge players with the correct time settings and a standard game name to help players recognise those incoming challenges

Is it possible to craft a URL that will trigger a game request automatically with set criteria?  For example, can I set the opponent, and game length / game name automatically in this way? 

It's be great if I could craft a 'Challenge This Player' link people could easily click.

BaronVonChickenpants

As an aside of finding this forum I've managed to pull in my players current Daily rating into my spreadsheet from the API, so I'm making progress!

SJCVChess

I'm new here and I'm only watching and listening passively.

Not sure if your intent is to push the "Challenge This Player" link. If that is your intent, then, going off of the current PubAPI, not seeing an Interactive API yet, pushing the link (if generated) is not possible.

I know I get e-mails about things from the website. I know I can refine what is sent. (Important note here.)

I did a brief investigation: I went to your profile, and one of the icons at the top is a "challenge this player" when I hover over it. When I click on that, I get a pop-up. If, in my (private) settings I allow random players to challenge me, then, if someone did this, I would probably receive an e-mail notification. That notification would have a link, and would force me to log-in.

Inspecting the "Play" button (code behind) is a div with a class. Most likely: Upon clicking that button, something executes in the JavaScript behind the scenes. You would need to analyze how all of that works, what information and commands are sent, etc.

That goes back to the PubAPI documentation saying that an Interactive API is forthcoming: The PubAPI is "read-only," such that you can't send that same information back, even if you could parse what happens or what goes on behind the scenes. (What if one player has blocked another player, in the same club.)

Assuming that eventually an Interactive API is released, it may or may not have such features. I would assume basics first, and club management later. If there were such a feature (later), to prevent abuse and spamming, it would likely have a limiter on response codes.

The point here is: Setup a dummy account to test sending yourself a challenge link. Look at the contents of that link (inspect the HTML behind the e-mail). Does it have a query string that can be parsed? I would guess that there's some information, but, it would not make sense. And that's probably because upon clicking the "play" button to challenge a player from the player's profile, something happens behind the scenes: The information is inserted in a database, processed, and then sent-out.

I would guess that you cannot construct links suggesting one player challenge another player (both members of a club). Allowing that functionality, without logging-in, or having an API key to manage creating such information, could lead to spam and abuse. Not just spamming or abusing individual players, but the overhead on the website's management systems.

Providing this type of feature is a bit of a burden on developers, because there's a lot of safety and security that needs to be considered, not just from a user standpoint, but also from the standpoint of systems administration.

Not saying it couldn't happen, but, if it does happen, it will be a ways off.

Why not just maintain a forum post suggesting member match-ups within the club?

Also, best guess: This is the best place to pose a question like this. Sorry I couldn't be more helpful.

skelos

Right place, but don't expect anything too soon: all current access to api.chess.com is anonymous (not logged in) so actions like sending a PM, a challenge, etc are not available. Maybe one day, but as there are still aspects of the site not accessible via api.chess.com at all (vote chess ...) I'm hoping the developers will continue to round out what we have as their priority.

 

I do agree an external application would be good for what you describe; trying to run a ladder in a forum is bit painful.

BaronVonChickenpants

Thanks for the feedback so far, I appreciate it.

 

I wasn't really expecting this to be part of the API just yet, and if it were it would probably be beyond my technical ability.  It would appear that something similar is possible with Live chess, a friend of mine found URL's in this format work:- https://www.chess.com/live?#time=15m0s10i&game=chess&rated=rated&minrating=any&maxrating=any&color=white&member=SirIvanhoe

For now, running challenges manually via the forum will work fine, but I was looking to make things easier to manage in the long run