I have read several pages on how to unset fields via PUT api calls. The Twitter Ads API documentation says to pass an empty string.
We are finding that we can’t unset the daily_budget_amount_local_micro on a twitter campaign via a PUT call. The sample request and response are shown below:
curl --request 'PUT' \
'https://ads-api.twitter.com/1/accounts/<account_id>/campaigns/<campaign_id>' \
--data 'daily_budget_amount_local_micro=' --header 'Authorization: OAuth \
oauth_consumer_key="<value>", oauth_nonce="<value>", \
oauth_signature="<value>", \
oauth_signature_method="HMAC-SHA1", \
oauth_timestamp="1473719906", oauth_token="<value>", \
oauth_version="1.0"' --verbose
{"errors":[{"code":"INVALID_PARAMETER",
"message":"Expected Long, got \"\" for daily_budget_amount_local_micro",
"parameter":"daily_budget_amount_local_micro"}],
"request":{"params":{"campaign_id":"<the campaign id>",
"account_id":"< the account id>"}}}
Here are the settings for the campaign that we’re using, minus the Ids:
{"request":{"params":{"campaign_id":"<campaign id>",
"account_id":"<account id>"}},
"data_type":"campaign",
"data":{"name":"Mon Sep 12 2016 18:38:42 GMT-0400 (EDT)102219",
"start_time":"2016-09-13T22:38:42Z",
"reasons_not_servable":["PAUSED_BY_ADVERTISER"],
"servable":false,
"daily_budget_amount_local_micro":5000000,
"end_time":null,
"funding_instrument_id":"<funding instrument id>",
"duration_in_days":null,
"standard_delivery":true,
"total_budget_amount_local_micro":null,
"id":"<campaign_id>",
"paused":true,
"account_id":"<account_id>",
"frequency_cap":null,
"currency":"USD",
"created_at":"2016-08-03T19:16:58Z",
"updated_at":"2016-09-12T22:38:43Z",
"deleted":false}}
Is there an undocumented restriction on unsetting daily_budget_amount_local_micro? Maybe, it can’t be unset if total_budget_amount_local_micro is null?