Create Line Item return INVALID_PARAMETER error

ads
api
campaign-management

#1

I’m trying to create new line item to my existing ads campaign. But it gives INVALID_PARAMETER exception. I used following Url to create line items.

https://ads-api.twitter.com/1/accounts/18ce54dd2m9/line_items?campaign_id=60oyl&name=test&product_type=PROMOTED_TWEETS&placements=TWITTER_TIMELINE&bid_amount_local_micro= 5000&objective=TWEET_ENGAGEMENTS

when I use this with twurl, It doesn’t throw error. but line item not created.

any idea ?


#2

@Spotdirect_dev: Thanks for your question and for providing the request using twurl.

The following error

{
  "errors": [
    {
      "code": "INVALID_PARAMETER",
      "message": "Expected Long, got \" 5000\" for bid_amount_local_micro",
      "parameter": "bid_amount_local_micro"
    }
  ]
}

is due to the fact that there is a space after the equals sign.

The reason a line item isn’t being created is that it’s not being sent as a POST request. Add the following (after removing the space) to your request and it should work: -X POST.

Hope this helps!


#3

Thank you juanshishido. It’s works fine now


#4

That’s great to hear, @Spotdirect_dev. If you have other questions, we’re here to help!