'AdCreativesV2 Batch GET API returns 400 BAD REQUEST - "Cannot process request involving multiple routing entities"

I am making API requests to a url like this to access AdCreatives API: https://api.linkedin.com/v2/adCreativesV2?ids=List(123,456,789) (not the exact ids, but you get the idea)

Depending on the IDs used in the call, sometimes this works as expected, and sometimes I get a 400 error code response with the message "Cannot process request involving multiple routing entities"

What does this mean, and how can I fix it?

I assume I can't make a request that includes all of these ids at once, but is there a way to tell which ids are causing the problem? This could help me group similar IDs successfully to make the call.



Solution 1:[1]

Have you checked you are using X-Restli-Protocol-Version: 2.0.0 in the header?
For example, for me in python this looks like

headers['X-Restli-Protocol-Version'] = '2.0.0'
r = requests.get(url, headers=headers)

This is mentioned on the docs here

Solution 2:[2]

Make sure that your Creatives belong to the same account. Based on LinkedIn's new error messages documentation, the new error message that will replace the "Cannot process request involving multiple routing entities" message is indicating that the ad account of the Creative_ids is not identical:

Entities should have the same ad account in batch update and batch partial update request.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sherm4n
Solution 2 Y.O