LoginSignup
0
0

More than 5 years have passed since last update.

YahooショッピングAPIのPOSTヘッダーの書き方を教えてください。

Last updated at Posted at 2015-02-25

Yahooショッピングの商品登録APIを使い、商品を追加仕様としています。
POSTヘッダーの書き方がわからず、どうしても「failed to open stream: HTTP request failed! HTTP/1.0 401 Authorization Required」となり、認証してくれません。
PHPのfile_get_contents関数を用いてPOST送信しています。
ご教授お願い致します。

現在の手順は以下の通りです。
1. 事前に手に入れたリフレッシュトークンから、アクセストークンを更新して取得。
2. 更新したアクセストークンを用いてPOSTヘッダーを生成。


$headers = array(
    'Content-Type: application/x-www-form-urlencoded',
    'User-Agent: Yahoo AppID: ' . $client_id,
    'Authorization: Bearer ' . $access_token,
);
※ $client_idはアプリケーションID、$access_tokenはアクセストークン

これを に送っています。
どこが間違っているのかわかりません。

リフレッシュトークンからアクセストークンは生成されているのですが...
よろしくお願い致します。

0
0
7

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0