Docs
Pings
Our documentation is a work in progress. We're slowly opening our API to the masses. Note that drastic changes may occur without warning.
Please let us know on GitHub what you need from our API and our docs, and the project in general.
The gist
Pings are only available for publications. To record the urls to ping, go to your publication and find the “ping” action.
SuperYesMore can get in touch with your application to let it know that some specific events have occured: an article has been created, modified, deleted etc.
If you run a website powered by SuperYesMore (you manage all your content on superyesmore.com but your website is published under your own url), you may not want to query the SuperYesMore API every time one of your user requests a page on your website: that's many HTTP requests that will slow down your website.
What you want is to store a local response of the SuperYesMore API on your server and use it to build your pages. No HTTP requests. No database (a .json file is perfectly fine).
When certain events occur, SuperYesMore can ping your application to let it know that the local .json file should be updated. When your website receives a ping, it queries the SuperYesMore API and update the .json file, ready to be served for your next users.
When an article is modified, added to the corpus of your publication, ore moved from the corpus of your publication, you can be notified so you can make the appropriate requests to the SuperYesMore API and store the updated responses on your server. Same goes for authors.
Validating the request
Before recording the urls to ping, you have generated a secret code. Never share this secret code.
When SuperYesMore pings your website, it will generate a unique random string and a hash which will be added to the query string:
https://url-to-ping.com?unique=$unique&hash=$hash
The hash
param is the result of a MD5
hash of the secret code and the unique
param. To make sure that it is SuperYesMore that is communicating with your website, grab the unique
string, hash it with your secret code (MD5), and check if the result is the same as the hash
param.
In PHP:
$secretCode = "your-secret-code-here"; // provided in the console on superyesmore.com. Never share this code.
$unique = $_GET["unique"];
$hash = $_GET["hash"];
$res = md5($unique.$secretCode);
if ($res !== $hash) {
die(); // This is not SuperYesMore
}
// Fine. Proceed.
Suggestions? Comments? More pings? Hit us on GitHub.