API Main Page

Revision as of 15:50, 24 December 2008 by Levans (talk | contribs) (New page: For PHP: Download AoPS.php and AoPS_API_PHP5_Rest.php Include AoPS.php in your code. Instantiate the AoPS Api object with your provided API key and Secret key Call AoPS API methods. Sa...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

For PHP: Download AoPS.php and AoPS_API_PHP5_Rest.php

Include AoPS.php in your code.

Instantiate the AoPS Api object with your provided API key and Secret key

Call AoPS API methods.

Sample: <?php require_once 'AoPS.php';

$appapikey = 'abcdefghijklmnopqrstuvwxyz123456';$appsecret = 'abcdefghijklmnopqrstuvwxyz123456'; $aops = new AoPS($appapikey, $appsecret);$username = $aops->api_client->user_get_username();$firstname = $aops->api_client->user_get_firstname(); if ($username === FALSE || $firstname === FALSE) {

   echo "Invalid user";

} else {

   echo "Hello " .$ (Error compiling LaTeX. Unknown error_msg)firstname . "! Your username is " . $username;

}