GetListItemsBySharedList API is not working

Tabrez Sayyed 0 Reputation points
2024-12-12T04:34:14.2833333+00:00

Here's how you can frame your question:


Hello Everyone,

I am facing an issue with the GetListItemsBySharedList API. While calling this API, I am encountering the following error:

"message" => "The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."

At the same time, the GetSharedEntityAssociationsBySharedEntityIds and GetSharedEntities APIs are working fine without any issues.

Here is the request payload I am using:

^ Microsoft\BingAds\V13\CampaignManagement\GetListItemsBySharedListRequest^ {#2695
  +SharedList: Microsoft\BingAds\V13\CampaignManagement\SharedList^ {#2530
    +ItemCount: null
    +AssociationCount: null
    +ForwardCompatibilityMap: null
    +Id: 21332-dummy-id
    +Name: null
    +Type: null
  }
  +SharedEntityScope: "Customer"
}

Could you please help me understand what might be causing this issue? Additionally, if there's a way to debug or resolve this error on the client side, I’d appreciate your guidance.

Thank you in advance!

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
437 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tabrez Sayyed 0 Reputation points
    2025-01-06T05:41:49.39+00:00

    Hi All,

    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());
    }
    
    0 comments No comments

Your answer

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