Here is the request that fetches the targeting value and also the request that its trying to create the targeting criteria for the campaign with that value. Could that inconsistency could be related with the fact that sandbox mode doesn’t have targeting criteria data up to date?
REQUEST that gets the targeting value from twitter
URL: https://ads-api.twitter.com/0/targeting_criteria/locations
Body:
{ q: ‘IL’, count: 1000 }
Response:
[
…
{
“name”:“Ilkadim, Samsun, Turkey”,
“targeting_type”:“LOCATION”,
“targeting_value”:“1a8b70e8164a6d74”,
“location_type”:“REGION”
}
…
]
REQUEST that tries to save the targeting criteria
URL: https://ads-api-sandbox.twitter.com/0/accounts/gq10ri/targeting_criteria
Body:
{
“params”: {
“line_item_id”:“d4ft”,
“targeting_type”:“LOCATION”,
“targeting_value”:“1a8b70e8164a6d74”,
“account_id”:“gq10ri”
}
}
Response:
ERROR [INVALID_RESPONSE_CODE] {“status_code”:400,“body”:{“errors”:[{“code”:“INVALID_PARAMETER”,“message”:“Expected valid targeting_value, got “1a8b70e8164a6d74” for targeting_value”,“parameter”:“targeting_value”}],“request”:{“params”:{“line_item_id”:“d4ft”,“targeting_type”:“LOCATION”,“targeting_value”:“1a8b70e8164a6d74”,“account_id”:“gq10ri”}}}}