This quickstart uses an OAuth2 library which can be found here:
To install the library first download the archive: https://github.com/adoy/PHP-OAuth2/archive/master.zip. Unzip the contents into a directory that your PHP script can access.
Include the following files from the library in your script:
Create a client with your client id and secret (you can retrieve the id and secret in your nation from Settings > Developer > Register app):
Now use the client to generate the authorization url.
The above will output:
Someone with access to the Nation's resources will have to visit that url in a browser, accept the application and retrieve the authorization code from the page url. That page url will look something like:
Use the code to generate an access token:
The client is now ready to make resource requests
The above will output something like:
Array ( [result] => Array ( [page] => 1 [total_pages] => 1 [per_page] => 10 [total] => 9 [results] => Array (  => Array ( [id] => 10 ... ) ...  => Array ( [id] => 19 ... ) ) ) [code] => 200 [content_type] => application/json )