我試圖通過Asana-php
連接到Asana API
。當我創建我的index.php
,並把代碼需要連接OAuth
我有一些問題,試圖連接到Asana. [this is my app in Asana][1]. How do I connect to
Asana`或我做錯了什麼。我的代碼是這樣的:使用PHP連接到Asana API
require '/vendor/autoload.php';
$ASANA_CLIENT_ID = getenv('my_asana_client_id');
$ASANA_CLIENT_SECRET = getenv('my_asana_client_secret');
$client = Asana\Client::oauth(array(
'client_id' => $ASANA_CLIENT_ID,
'client_secret' => $ASANA_CLIENT_SECRET,
// this special redirect URI will prompt the user to copy/paste the code.
// useful for command line scripts and other non-web apps
'redirect_uri' => 'https://chefpepper.dyndns.org/ChefPepperProjects/auth/asana/callback'
));
echo "authorized=" . $client->dispatcher->authorized . "\n";
# get an authorization URL:
$state = null;
$url = $client->dispatcher->authorizationUrl($state);`