如何通过Apple Search Ads API制作广告系列

时间:2017-03-17 12:20:34

标签: java python-2.7 sh

我尝试通过Apple Search Ads API创建广告系列。所以我用

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"]}]}'

我收到以下错误消息:

{"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"}]}}

我曾多次尝试过不同的方式,但仍然无法正常工作。有没有聪明人可以帮助我?

提前致谢!

2 个答案:

答案 0 :(得分:0)

我认为你需要指定你发送一个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"

答案 1 :(得分:0)

除了内容类型标题, 金额需要采用字符串格式

'{"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"]}]}'
https://developer.apple.com/library/content/documentation/General/Conceptual/AppStoreSearchAdsAPIReference/API_Overview.html中的

该示例还使用字符串作为项目