Can't submit line item with product_type and placements


#1

Trying to make a request as describedhere. When I make the request with these 2 parameters filled, I get the error response:
“non-nullable field placement_type is not set”

According to the docs, we can’t use placement_type and placements/product_type in the same request, and indeed when I try to include this parameter in the request, I get the error response:
“placement_type and placements are exclusive parameters”

What am I missing here? It seems I can’t use placements/product_type exclusively as required in the docs.


#2

Could you provide an example request and response showing this issue on your end? (See our Guidelines for Reporting Issues


#3

Thanks for responding and sorry for not providing enough info. Somehow this morning I am succeeding in calling this endpoint using product_type and placements exclusively.


#4

OK, so sometimes it works and sometimes I get the error as described above as well as one other error it turns out.

Here’s are my request parameters (everything else should be fine since I’m not getting any auth errors:

array (
‘campaign_id’ => ‘3cozb’,
‘account_id’ => ‘xxxxxxx’,
‘placements’ => ‘TWITTER_SEARCH,TWITTER_PROFILE’,
‘product_type’ => ‘PROMOTED_TWEETS’,
‘bid_amount_local_micro’ => 1000000,
‘automatically_select_bid’ => 0,
‘name’ => ‘e213e’,
)

Here’s the response:

HTTP/1.1 400 Bad Request
content-disposition: attachment; filename=json.json
content-length: 523
content-type: application/json;charset=utf-8
date: Wed, 21 Oct 2015 13:15:23 GMT
server: tsa_b
set-cookie: guest_id=v1%3A144543332369095162; Domain=.twitter.com; Path=/; Expires=Fri, 20-Oct-2017 13:15:23 UTC
strict-transport-security: max-age=631138519
x-access-level: read-write-directmessages
x-connection-hash: 6c516c71730d63253ff709822bdb78f0
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-rate-limit-limit: 300
x-rate-limit-remaining: 299
x-rate-limit-reset: 1445433370
x-response-time: 160
x-runtime: 0.150418
x-transaction: a2bc3cc3ca9523e9
x-tsa-request-body-time: 0
x-xss-protection: 1; mode=block

{“errors”:[{“code”:“INVALID”,“message”:“non-nullable field placement_type is not set”,“attribute”:“placement_type”},{“code”:“INVALID”,“message”:“LineItem PromotedProductType PROMOTED_TWEETS is not compatible with placements SEARCH_RESULTS,PROFILES”,“attribute”:“promoted_product_type”}],“request”:{“params”:{“name”:“e213e”,“placements”:[“TWITTER_SEARCH”,“TWITTER_PROFILE”],“bid_amount_local_micro”:1000000,“automatically_select_bid”:false,“product_type”:“PROMOTED_TWEETS”,“account_id”:“xxxxx”,“campaign_id”:“3cozb”}}}


#5

Ah, I see. The issue here is that the combination of placements and product_type passed in is not valid. The error message here can definitely use some work though. To get a list of valid placements and product_type combinations, you can use the GET line_items/placements endpoint.


#6

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.