Php 正在Pinterest上获取访问令牌

Php 正在Pinterest上获取访问令牌,php,pinterest,Php,Pinterest,我正在尝试通过php curl获取pinterest访问令牌。 但我得到了以下回应 {"status": "failure", "code": 5, "host": "coreapp-ngapi-prod-0a010eba", "generated_at": "Wed, 26 Oct 2016 03:42:04 +0000", "message": "Method not allowed", "data": "405: Method Not Allowed"} 我的卷曲如下 $clientId

我正在尝试通过php curl获取pinterest访问令牌。 但我得到了以下回应

{"status": "failure", "code": 5, "host": "coreapp-ngapi-prod-0a010eba", "generated_at": "Wed, 26 Oct 2016 03:42:04 +0000", "message": "Method not allowed", "data": "405: Method Not Allowed"}
我的卷曲如下

$clientId     = 'XXXX';
$clientSecret = 'YYY';
$authCode     = 'ZZZ';

$uri = 'https://api.pinterest.com/v3/oauth/token?grant_type=authorization_code&client_id=' . $clientId . '&client_secret=' . $clientSecret . '&code=' . $authCode;


$ch = curl_init( $uri );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0);

$response = curl_exec( $ch );
if( curl_errno($ch) ){
    echo 'Curl error: ' . curl_error($ch);
}
echo 'Response : ' . $response;
exit;

使用get方法而不是post方法同样的响应是否也使用get方法?grant_type=authorization_code&client_id=12345&client_secret=6789abcd&code=XYZ1010检查此@NavjotSingh,v3是pinterest的最新版本,我尝试了v1,但没有成功。