GET targeting_criteria/behaviors not working


#1

Hi there! I am trying to get behaviors by using the endpoint https://dev.twitter.com/ads/reference/get/targeting_criteria/behaviors, but I always get INTERNAL_ERROR. I tried with no parameters at all, and with differrent combinations of parameters - all of these calls give INTERNAL_ERROR.

Do I need to be whitelisted to be able to use behaviour targeting? Because I didn’t see any feature key that could be related to this, at https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/features.

Thank you!


#2

Hello,

Is it possible that you are calling /0/accounts/:account_id/targeting_criteria/behaviors?

I was just able to call “/0/targeting_criteria/behaviors” without any parameters and it returned the default behaviors (it defaults to US if a country code is not provided). If this doesn’t fix the issue for you, please post a twurl example.

Thanks,

John


#3

Hi @JBabichJapan! Thank you for your answer.

I’m calling the correct endpoint. But now I see that with no parameters it works - something must have changed since yesterday…

But when I try to add the parameter sort_by=name-asc I get the INTERNAL_ERROR error:

Request:
GET https://ads-api.twitter.com/0/targeting_criteria/behaviors.json?sort_by=name-asc

Response:
HTTP/1.1 500 Internal Server Error
connection: close
content-disposition: attachment; filename=json.json
content-encoding: gzip
content-length: 109
content-type: application/json;charset=utf-8
date: Thu, 24 Mar 2016 08:47:09 GMT
server: tsa_b
set-cookie: guest_id=v1%3A145880922975611498; Domain=.twitter.com; Path=/; Expires=Sat, 24-Mar-2018 08:47:09 UTC
strict-transport-security: max-age=631138519
x-access-level: read-write
x-connection-hash: 96674fa485434169f36f3b9010cbec99
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-response-time: 18
x-runtime: 0.008074
x-transaction: 44fb712fbbefbf63
x-xss-protection: 1; mode=block

{“errors”:[{“code”:“INTERNAL_ERROR”,“message”:“Internal Error”}],“request”:{“params”:{}}}

(I’ve never used twurl.)

Note that params is empty - it doesn’t recognize my sort_by parameter.

If I make the request with only country_code it works (https://ads-api.twitter.com/0/targeting_criteria/behaviors.json?country_code=US), but as soon as I add the sort_by parameter, the INTERNAL_ERROR occurs.

I’ve looked at Problem with behaviors sort_by parameter but didn’t help.

Thank you.


#4

Can anyone help me please? This is still returning INTERNAL_ERROR when using the sort_by parameter equal to name-asc.


#5

I am marking this as resolved, as the problem is actually in the topic Problem with behaviors sort_by parameter.