UNEXPECTED_INTERNAL_API_ERROR upon deleting product groups

7 views
Skip to first unread message

Marketing Operations

unread,
Jun 28, 2019, 11:49:08 PM6/28/19
to AdWords API and Google Ads API Forum
Hi,
I am trying to delete product groups on my account using Adwords API v201809. 
I keep getting UNEXPECTED_INTERNAL_API_ERROR and I am not able to tell what the error possible could be ? 
Any help is appreciate here. 




session.setClientCustomerId(accountId);
    String KEY_TO_EXTRACT_PRODUCT_TYPE = "value=";

    if (partitionTree == null) {
      partitionTree = ProductPartitionTree.createAdGroupTree(adWordsServices, session, adGroupId);
    }

    //get the root from the tree
    ProductPartitionNode root = partitionTree.getRoot();
    ProductPartitionNode subDivisionNode;
    // get root as subdivision as that is the actionable object
    String adwordsProductType = "";
    for (ProductPartitionNode node: root.getChildren()) {
      // We are trying to extract the correct product type on adwords. This is because there are times when
      // the product type in our SQL DB is different from that on adwords because of encoding issues. Example - (notice the difference in dash)
      // '[global] small electrics – body weight scales' (on adwords) and '[global] small electrics - body weight scales' (on SQL DB)
      if (node.getDimension().toString().contains(KEY_TO_EXTRACT_PRODUCT_TYPE)) {
        // this is to extract the product type value from a string like 'ProductType{productDimensionType=ProductType, type=PRODUCT_TYPE_L1, value=[global] storage and org - [closet storage] baskets boxes & buckets}'
        adwordsProductType = node.getDimension().toString().substring(node.getDimension().toString().indexOf(KEY_TO_EXTRACT_PRODUCT_TYPE) + KEY_TO_EXTRACT_PRODUCT_TYPE.length());
        adwordsProductType = adwordsProductType.substring(0, adwordsProductType.indexOf('}'));
        break;
      }
    }

    root = root.asSubdivision();

    //adding or fetching the subdivision from the root
    if (!adwordsProductType.equals(productType)) {
      log.error(String.format("Product Type of ad groups was changed from %s to %s", productType, adwordsProductType));
      productType = adwordsProductType;
    }
    subDivisionNode =  root.getChild(ProductDimensions.createType(PRODUCT_TYPE_L1, productType)).asSubdivision();

    ProductDimension itemProductDimenion = ProductDimensions.createOfferId(itemId);
    itemProductDimenion.setProductDimensionType(PRODUCT_OFFER_ID);
    // A check to ensure that the item id exists.
    if (!subDivisionNode.hasChild(itemProductDimenion)) {
      log.error(String.format("Missing: ItemId %s not found.\n", itemId));
      plasNotFound.add(recordId);
    } else {
        //adding the child node to the subdivision
        subDivisionNode.removeChild(itemProductDimenion);
      }
    }

Google Ads API Forum Advisor Prod

unread,
Jul 1, 2019, 2:34:45 AM7/1/19
to adwor...@googlegroups.com
Hi,

Thanks for posting your concern.

To take a closer on the issue, would you mind providing the complete SOAP request and response logs together with the CID and the error message via Reply privately to author option? If you haven't enabled the SOAP logging yet, you may refer to the readMe section of the respective client library for instructions on how to do it.

Regards,
Ejay
Google Ads API Team

ref:_00D1U1174p._5001UCa6oh:ref
Reply all
Reply to author
Forward
0 new messages