1

我正在尝试向 zuora 发出发布请求以获取 accessToken,但我从正文中收到此错误:

{
  "message":"Does not include required parameters"
}

非常感谢!

const request = require("request");
const headers = {
  "Content-Type": "application/x-www-form-urlencoded"
};
var string =
  "client_id=xxxxxx&clientSecret=xxxxxxxxxx&grant_type=client_credentials";
request(
  {
    url: "https://rest.sandbox.eu.zuora.com/oauth/token",
    method: "POST",
    headers: headers,
    body: string
  },
  function (error, response, body) {
    console.log(body);
  }
);

那是邮递员ApiKey,它在邮递员中工作。这是文档,我无法弄清楚。 https://www.zuora.com/developer/api-reference/#operation/createToken || https://any-api.com/zuora_com/zuora_com/docs/OAuth/createToken

 {
    "name": "Authentication",
    "item": [
        {
            "name": "Auth Token",
            "request": {
                "method": "POST",
                "header": [],
                "body": {
                    "mode": "urlencoded",
                    "urlencoded": [
                        {
                            "key": "client_id",
                            "value": "xxxxx",
                            "type": "text"
                        },
                        {
                            "key": "client_secret",
                            "value": "xxxxxx",
                            "type": "text"
                        },
                        {
                            "key": "grant_type",
                            "value": "client_credentials",
                            "type": "text"
                        }
                    ]
                },
                "url": {
                    "raw": "https://rest.sandbox.eu.zuora.com/oauth/token",
                    "protocol": "https",
                    "host": [
                        "rest",
                        "sandbox",
                        "eu",
                        "zuora",
                        "com"
                    ],
                    "path": [
                        "oauth",
                        "token"
                    ]
                }
            },
            "response": []
        }
    ]
}
4

0 回答 0