* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ // To change the API key, replace the REPLACE_THIS_WITH_AN_API_KEY with your desired API key. $restAPI = new RestAPI('REPLACE_THIS_WITH_AN_API_KEY'); # DO NOT CHANGE ANYTHING BELOW THIS LINE UNLESS # YOU REALLY KNOW WHAT ARE YOU DOING // Process the request if ($restAPI->getAPIKey() !== NULL && $restAPI->isDefaultAPIKey()) { // API is set but not changed from the default API key. $restAPI->throwError(17); } else { if ($restAPI->getAPIKey() !== NULL && !$restAPI->hasRequest('hash') && !$restAPI->isPublicAction()) { // Hash argument is required and was not found, throw error. $restAPI->throwError(3, 'hash'); } else { if (!$restAPI->getHash() && !$restAPI->isPublicAction()) { // Hash argument is empty or not set, throw error. $restAPI->throwError(1, 'hash'); } else { if (!$restAPI->isAuthenticated() && !$restAPI->isPublicAction()) { // Hash is not valid and action is not public, throw error. $restAPI->throwError(6, $restAPI->getHash(), 'hash'); } else { if (!$restAPI->hasRequest('action')) { // Action argument was not found, throw error. $restAPI->throwError(3, 'action'); } else {