Batch delete NETWORK_ACTIVATION_DURATION targeting criteria throws error


#1

When I try to use the batch targeting criteria endpoint - https://ads-api.twitter.com/0/batch/accounts/okrly1/targeting_criteria
with operation_type = Delete and targeting_criterion_id where targeting criteria contains NETWORK_ACTIVATION_DURATION targeting_type I get an error like
"null was not found for account <account_id>"

I cannot interpret anything from the error that is thrown. The above mentioned batch call works for deleting targeting_criterion_id where the targeting criteria contains other targeting_type eg: BEHAVIOR. It just doesn’t work for NETWORK_ACTIVATION_DURATION.

Can someone please look into this issue?


#2

Hi @TeamUpatel! To me, the error says that a targeting_criterion_id with a value of null creeps in the batch delete call. null was not found for account ..., i.e. “Targeting criterion with id null was not found for account …”.

Does that help?


#3

So that is the first thing I checked for too. And I see that the targeting criterion id is not being passed as null. That is what surprises me too. In the response that twitter sends me there is a request section with params and I do see valid targeting_criterion_id passed in and the operation_type as Delete and my account id. And I also checked that its a valid targeting_criterion_id existing on twitter side.


#4

@TeamUpatel @majoritasdev facing the same issue, any suggestions?


#5

Hi @abhishek_pyro! I’m afraid not… I don’t use the batch endpoints. Maybe if you two would post your raw requests, a Twitter Staff member could check if there’s a bug on their side.


#6

@abhishek_pyro : Since we were under time crunch and no one from twitter side was responding, we added a work around on our end to not use the batch endpoint when there is NETWORK_ACTIVATION_DURATION targeting_type involved. We just use the simple delete endpoint for that. It is definitely bug on Twitter side. I emailed their rep separately about it but no one responded to it.


#7

@hector_borras would you be able to help us here.


#8

@majoritasdev

This is my raw params json

[{“params”:{“targeting_type”:“NETWORK_ACTIVATION_DURATION”,“line_item_id”:“5ogpv”,“negated”:false,“id”:“99i4ep”,“deleted”:true,“targeting_criterion_id”:“99i4ep”},“operation_type”:“Delete”},{“params”:{“targeting_type”:“UNORDERED_KEYWORD”,“line_item_id”:“5ogpv”,“negated”:false,“id”:“99i4es”,“deleted”:true,“targeting_criterion_id”:“99i4es”},“operation_type”:“Delete”},{“params”:{“targeting_type”:“LANGUAGE”,“line_item_id”:“5ogpv”,“negated”:false,“id”:“99i4f6”,“deleted”:true,“targeting_criterion_id”:“99i4f6”},“operation_type”:“Delete”},{“params”:{“targeting_type”:“PHRASE_KEYWORD”,“line_item_id”:“5ogpv”,“negated”:false,“id”:“99i4eu”,“deleted”:true,“targeting_criterion_id”:“99i4eu”},“operation_type”:“Delete”}]


#9

@abhishek_pyro: As far as I can see, your parameters are not formatted as in the docs. They shoud be:

[
    {
        "operation_type": "Delete",
        "params": {
            "id": "99i4ep"
        }
    },
    {
        "operation_type": "Delete",
        "params": {
            "id": "99i4es"
        }
    },
    {
        "operation_type": "Delete",
        "params": {
            "id": "99i4f6"
        }
    },
    {
        "operation_type": "Delete",
        "params": {
            "id": "99i4eu"
        }
    }
]

#10

Sorry @abhishek_pyro,

I don’t use that endpoint… and also I don’t usually use NETWORK_ACTIVATION_DURATION


#11

I am still encountering this same issue. Any word on a fix coming for this, @juanshishido?


#12

@pakrouse: Thanks for flagging this. The team will take a look next week.


#13

@juanshishido I’m also seeing the same error when trying to delete a PLATFORM_VERSION target:

{
  "request": [
    {
      "params": {
        "targeting_criterion_id": "dilgwe",
        "account_id": "XXXXXX"
      },
      "operation_type": "Delete"
    }
  ],
  "operation_errors": [
    [
      {
        "code": "NOT_FOUND",
        "message": "null was not found for Account XXXXXX"
      }
    ]
  ]
}

#14

Thanks for following up, @pakrouse. We haven’t been able to reproduce this. Please see the example below.

# target the Android platform
$ twurl -X POST -H ads-api.twitter.com "/1/accounts/18ce54d4x5t/targeting_criteria?line_item_id=8r2yj&targeting_type=PLATFORM&targeting_value=1"
{
  "data_type": "targeting_criterion",
  "data": {
    "line_item_id": "8r2yj",
    "name": "Android",
    "id": "dirqqb",
    "account_id": "18ce54d4x5t",
    "created_at": "2017-05-16T04:13:48Z",
    "targeting_value": 1,
    "updated_at": "2017-05-16T04:13:48Z",
    "deleted": false,
    "targeting_type": "PLATFORM"
  },
  "request": {
    "params": {
      "line_item_id": "8r2yj",
      "targeting_type": "PLATFORM",
      "targeting_value": 1,
      "account_id": "18ce54d4x5t"
    }
  }
}

The id—in this case, dirqqb—is what we’ll be deleting in the subsequent step.

# deleting the targeting criterion using the batch endpoint
$ twurl -H ads-api.twitter.com -X POST -A "Content-Type: application/json" -d '[{"operation_type":"Delete","params":{"targeting_criterion_id":"dirqqb"}}]' "/1/batch/accounts/18ce54d4x5t/targeting_criteria"
{
  "data_type": "targeting_criterion",
  "data": [
    {
      "line_item_id": "8r2yj",
      "name": "Android",
      "id": "dirqqb",
      "operator_type": "EQ",
      "created_at": "2017-05-16T04:13:48Z",
      "targeting_value": 1,
      "updated_at": "2017-05-16T04:15:41Z",
      "deleted": true,
      "targeting_type": "PLATFORM"
    }
  ],
  "request": [
    {
      "params": {
        "targeting_criterion_id": "dirqqb",
        "account_id": "18ce54d4x5t"
      },
      "operation_type": "Delete"
    }
  ]
}

We were able to successfully delete this targeting criterion. Notice that "deleted": true in the response. Please ensure that your request is set up the same as what’s shown above.


The NOT_FOUND error code could mean that the ID you’re specifying is incorrect (or has already been deleted).


#15

Thanks for looking at this @juanshishido. This issue is actually with the PLATFORM_VERSION target type. PLATFORM target type works correctly, as you said.

You should be able to replicate my error with the PLATFORM_VERSION target type.


#16

Thanks for clarifying, @pakrouse. We’ll continue to investigate this.