Share via

Internal error on getlistitemsbysharedlist

Virtual Brix API 1 Reputation point
2022-01-19T17:38:27.387+00:00
    $serviceCall = $this->service->call(ServiceClientType::CampaignManagementVersion13);  
    $request = new GetListItemsBySharedListRequest();  
    $sharedList = new NegativeKeywordList();  
    $sharedList->Id = $sharedListId + 0;  

    $request->SharedEntityScope = EntityScope::Account;  
    $request->SharedList = $sharedList;  

    try {  
        $items = $serviceCall->GetService()->GetListItemsBySharedList($request);  
        return $items;  
    } catch (\Exception $e) {  
        return false;  
    }  

above code returns internal error code.
How can I check the detail error message?
166379-image.png

Community Center | Not monitored
0 comments No comments

2 answers

Sort by: Most helpful
  1. IoTGirl 3,961 Reputation points Microsoft Employee Moderator
    2022-01-20T01:32:57.04+00:00

    Hi @Virtual Brix API ,

    As this is a Bing Ads API,https://learn.microsoft.com/en-us/advertising/campaign-management-service/getlistitemsbysharedlist?view=bingads-13, have you logged in to your Microsoft Ads account to get Support? (See Bing Ads at https://support.microsoft.com/en-us/topic/1831f0fe-3c4d-46ae-8e57-16c487715729)

    Sincerely,
    IoTGirl

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Tabrez Sayyed 0 Reputation points
    2025-01-06T05:37:13.3166667+00:00

    Hi @Virtual Brix API ,

    I have found the solution to the above function. Please refer to the code below:

    try {
        // Create a PlacementExclusionList instance
        $sharedList = new PlacementExclusionList();
        $sharedList->Id = "Your-Shared-List-ID";
    
        // Create the request
        $request = new GetListItemsBySharedListRequest();
        $request->SharedList = new SoapVar(
            $sharedList,
            SOAP_ENC_OBJECT,
            'PlacementExclusionList', // Derived type
            'https://bingads.microsoft.com/CampaignManagement/v13' // Namespace
        );
        $request->SharedEntityScope = "Customer";
    
        // Send the request
        $response = $GLOBALS['CampaignManagementProxy']->GetService()->GetListItemsBySharedList($request);
        dd($response);
    } catch (SoapFault $e) {
        dump("SOAP Fault:", [
            'faultcode' => $e->faultcode,
            'faultstring' => $e->faultstring,
        ]);
    
        // Retrieve and display the last SOAP request for debugging
        if (isset($GLOBALS['CampaignManagementProxy'])) {
            dump("Last SOAP Request:", $GLOBALS['CampaignManagementProxy']->GetService()->__getLastRequest());
        }
    } catch (Exception $e) {
        dump("General Exception:", $e->getMessage());
    }
    

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.