简体   繁体   English

如何通过Apple Search Ads API创建广告系列

[英]How to create campaign through Apple Search Ads API

I'm trying to create Campaign through Apple Search Ads API. 我正在尝试通过Apple Search Ads API创建广告系列。 So I use 所以我用

curl -X POST https://api.searchads.apple.com/api/v1/campaigns \
--cert path/XXXX.p12 \
--pass ****  \
-H "Authorization: orgId=xxxx" \
-d '{"budgetAmount":{"currency":"USD","amount": 50.0},"name": "weixinCampagin", "adamId":"414478124","adGroups": [{"name": "weixinCampaginAdGroup","startTime":"2017-03-17 00:00:00","defaultCpcBid": {"amount": 1,"currency":"USD"},"storeFronts": ["US"]}]}'

I got the following error messages: 我收到以下错误消息:

{"data":null,"pagination":null,"error":{"errors":[{"messageCode":"INVALID_ATTRIBUTE_TYPE","message":"This is an invalid request. At least one field format is not readable by the system.","field":"Line#:1 Column#:50"}]}}

I have tried many times through different ways, but still not working. 我已经通过不同的方式尝试了很多次,但是仍然无法正常工作。 Is there any smart guys can help me? 有什么聪明的人可以帮助我吗?

Thanks in advance! 提前致谢!

I think you need to specify that you're sending a json object. 我认为您需要指定要发送的json对象。

curl \
 --cert ./<FILENAME>.p12 \
 --pass <PASSWORD> \
 -H "Authorization: orgId=<ORG_ID>" \
 -H "Content-Type: application/json" \
 -d "<CAMPAIGN_DATA_FILE>.json" \
 -X POST "https://api.searchads.apple.com/api/v1/campaigns"

Apart from content-type header, The amount needs to be in string format 除了内容类型标题外,金额还必须为字符串格式

'{"budgetAmount":{"currency":"USD","amount": "50.0"},"name": "weixinCampagin", "adamId":"414478124","adGroups": [{"name": "weixinCampaginAdGroup","startTime":"2017-03-17 00:00:00","defaultCpcBid": {"amount": "1","currency":"USD"},"storeFronts": ["US"]}]}'

in https://developer.apple.com/library/content/documentation/General/Conceptual/AppStoreSearchAdsAPIReference/API_Overview.html the sample also uses string for the amount item https://developer.apple.com/library/content/documentation/General/Conceptual/AppStoreSearchAdsAPIReference/API_Overview.html中 ,示例还对金额项目使用了字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM