gpt4 book ai didi

node.js - 使用 node-soap 连接 Bing Ads API

转载 作者:搜寻专家 更新时间:2023-11-01 00:38:04 33 4
gpt4 key购买 nike

我正在尝试使用 node-soap 连接到 bing ads soap api。我已经按照 bing documentation 中的建议创建了请求.但每次我尝试连接时,响应都会显示无效凭据(错误代码 - 105)消息 - 身份验证失败。提供的凭据无效或帐户处于非事件状态。

我能够使用 bing 提供的示例 C# 代码对 API 进行身份验证。因此,很明显凭据/ token 运行良好。

有没有办法确定我的方法或 Node 代码中的问题。

soap.createClient(url, function (err, client) {
if (err) {
console.log("err", err);
} else {
client.addSoapHeader({
'AuthenticationToken': '<AuthenticationToken>',
'DeveloperToken': '<DeveloperToken>',
'CustomerId': '<CustomerId>',
'CustomerAccountId': '<CustomerAccountId>',
});
client.SubmitGenerateReport(args, function (err, result) {
if (err) {
console.log("err", err.body);
} else {
console.log(result);
}
});
}
});

PS:Bing 文档糟透了。向 Stackoverflow 致敬!

最佳答案

您需要在 header 中为每个 key 添加前缀 tns,例如:tns:AuthenticationToken

关于node.js - 使用 node-soap 连接 Bing Ads API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44590474/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com