upwork APIライブラリhttps://github.com/upwork/php-upworkを使用している間、私は未定義の定数OAUTH_AUTH_TYPE_FORMのエラー を使用しました。使用 - 仮定「OAUTH_AUTH_TYPE_FORM」 - 仮定「OAUTH_AUTH_TYPE_FORM」
私はOAuth1を使用しています - AUTHTYPE
は、ここで私が書いたコードです:彼らのreadmeファイルを1として
$config = new \Upwork\API\Config(
array('consumerKey' => 'MY_KEY',
'consumerSecret' => 'MY_SECRET',
'accessToken' => \Session::get('access_token'),
'accessSecret' => \Session::get('access_secret'),
'verifySsl' => false,
'debug' => false,
'authType' => 'OAuth1'
)
);
$client = new \Upwork\API\Client($config);
if (!empty(\Session::get('access_token')) && !empty(\Session::get('access_secret'))) {
$client->getServer()
->getInstance()
->addServerToken(
$config::get('consumerKey'),
'access',
\Session::get('access_token'),
\Session::get('access_secret'),
0
);
} else {
// $accessTokenInfo has the following structure
// array('access_token' => ..., 'access_secret' => ...);
// keeps the access token in a secure place
// gets info of authenticated user
$accessTokenInfo = $client->auth();
}
$auth = new \Upwork\API\Routers\Auth($client);
print_r($auth);
upworkの問題を報告します。彼らはコードに未定義の定数を使用しています – zerkms