網頁

2014年5月21日

痞客邦pixnet api 自動發文 - php curl

oauth 2 認證方式

$url = "https://emma.pixnet.cc/oauth2/authorize";

$return_url = "http://";

$api = "https://emma.pixnet.cc/oauth2/authorize?redirect_uri=".$return_url."&client_id=".$client_id."&response_type=code";

curl($api);

之後會return code

$code = $_GET['code'];

$get_token = "https://emma.pixnet.cc/oauth2/grant?grant_type=authorization_code&code={$code}&redirect_uri={$return_url}&client_id={$client_id}&client_secret={$client_secret}";

ok,取得access_token就可以了!!

沒有留言:

張貼留言