Hi,
I was told here
that with ads api 11 the dates were now at line item level and not at campaign level.
So I create a campaign with this params
https://ads-api.twitter.com/11/accounts/xxxx/campaigns
name: xxx
funding_instrument_id: xxx
entity_status: PAUSED
standard_delivery: true
total_budget_amount_local_micro: 10000000
daily_budget_amount_local_micro: 5000000
And then I create a line item for that campaign with this params
https://ads-api.twitter.com/11/accounts/xxxxx/line_items
start_time: 2022-06-17T09:05:00Z
end_time: 2022-06-18T21:59:00Z
campaign_id: xxx (the returned id from the previews call)
bid_amount_local_micro: 1000000
entity_status: PAUSED
objective: ENGAGEMENTS
product_type: PROMOTED_TWEETS
placements: ALL_ON_TWITTER
bid_strategy: MAX
A also create a targeting criteria and a promoted tweets but that’s not important for this subject.
The problem comes when I try to update line item with this params
https://ads-api.twitter.com/11/accounts/xxx/line_items/xxxx
start_time: 2022-07-22T09:05:00Z
end_time: 2022-07-23T21:59:00Z
The response has this error
{
“errors”: [
{
“code”: “INVALID”,
“message”: “Campaign EndTime: 2022-06-18T21:59:00Z is before its LineItem StartTime: 2022-07-22T09:05:00Z”,
“attribute”: “end_time”
},
{
“code”: “INVALID”,
“message”: “Campaign EndTime: 2022-06-18T21:59:00Z is before its LineItem EndTime: 2022-07-23T21:59:00Z”,
“attribute”: “end_time”
}
],
“request”: {
“params”: {
“line_item_id”: “xxxx”,
“start_time”: “2022-07-22T09:05:00Z”,
“end_time”: “2022-07-23T21:59:00Z”,
“account_id”: “xxxx”
}
}
}
But the campaign has been created with no dates.
Thanks