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

Hello,

Thanks for reaching out. The start_time and end_time parameters were removed in v11 and campaigns use the times set on the line items. These information can be found here.

You may also want to refer to this forum question for more details on it.

Hi @jaredtcy,
I know that, but as you can see in the params of my previous post, I set the dates at line item level but now they can’t be updated.

Thanks

Hello,

Could you try changing the end_time first followed by the start_time after? (Once the end_time is updated successfully).

Hi @jaredtcy,
I’ve tested what you said and I obtain the same error when updating the end time.

I think there is a bug on your side. With the old api 10 I could update campaign dates with an only call like this with no problem:

url: https://ads-api.twitter.com/10/accounts/xxxx/campaigns/xxx
– params begin –
start_time: 2022-07-15T11:57:00Z
end_time: 2022-07-16T21:59:00Z
– params end –

I think that api 11 should behave the same way with line item dates

Thanks

Hello,

Thanks for the details. We will be researching on this issue.

Thank you for reporting this. We’ve notified the engineering team and will update this thread when this is resolved.