Instagram API 订阅端点要求访问令牌,即使它已提供

Instagram API Subscription endpoint asks for access token even though it is provided

我正在向 Instagram API 订阅端点发送 POST 请求以添加用户订阅,但出现错误:

error: StatusCodeError: 400 - {"meta": {"code":400, "error_type":"OAuthParameterException", "error_message":"Missing client_id or access_token URL parameter."}}

我在请求中同时提供了 client_idaccess_token

这是请求代码。

let access_token = user[0].access_token
let options = {
        method: 'POST',
        uri: `https://api.instagram.com/v1/subscriptions/`,
        body: {
          access_token: access_token,
          client_id: instaConfig.client_id,
          client_secret: instaConfig.client_secret,
          object: 'user',
          aspect: 'media',
          verify_token: 'myVerifyToken',
          callback_url: `${callback_url}`
        },
        headers: {
          'User-Agent': 'Request-Promise'
        },
        // Automatically parses the JSON string in the response
        json: true
      }
// rp = require('request-promise')
      rp(options)
        .then((response) => {
          console.log('subscriptions response: ' + util.inspect(response, { showHidden: true, depth: null }))
        })
        .catch((err) => {
          console.log('error: ' + err)
        })

它不会从 body 读取。它需要从查询参数或 headers.

传递