I think there is a problem with the quickstart for PHP.
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:
GET http://yourapp.example.com/oauth_callback?code=123456abcdef
Use the code to generate an access token:
But it doesn't make sense, this a program, not a person accessing a browser and getting the code. How can I get the code
using PHP, not someone visiting the url in a browser?
Anthony
Official response from Farz Sokhansanj
The process this is describing is the admin workflow for authenticating the application with the nation. We have example code for authenticating with PHP in our API documentation.
Share this post
Showing 2 reactions
Sign in with
```
$client = new OAuth2\Client($clientId, $clientSecret);
$baseApiUrl = ‘https://foobar.nationbuilder.com’;
$client->setAccessToken($token);
$response = $client->fetch($baseApiUrl . ‘/api/v1/people’);
print_r($response);
```
If Nation Builder want us to get the token this convoluted way, it needs to be documented better.