WSProxy setClientId in Child BU does not allow execute at Parent BU

In SF Marketing Cloud, I’m trying to update a subscriber at the Parent BU Level from my SSJS in the Child BU.

I created a Cloud Page at the Child BU to run the following code in order to debug faster.

<script  runat="server">

Platform.Load("core","1.1.5");
var prox = new Script.Util.WSProxy();

//Switch context to different BU. Change the MID to suit.
  prox.setClientId({"ID":XXXXXXXXX});
  var props = [
{Name:"SubscriberKey", Value:"XXXXXXXXXXXXXXXXX"},
{Name:"ListID", Value:XX},
{Name:"DoNotTrack", Value:"True"}];

var data = prox.execute(props, "Log Update Subscriber property");
Write(Stringify(data));
</script>

I received the following message in the response

{"Status":"Error","RequestID":"a88391ed-04e8-4590-a77e-2ad220c1b8b9","Results":[{"StatusCode":"Error","StatusMessage":"RequestID: a88391ed-04e8-4590-a77e-2ad220c1b8b9  Message: MemberID 1000XXXXX does not have access to ClientID: ID[10000XXXX] PartnerClientKey[] UserID[] PartnerUserKey[] supplied in the request","OrdinalID":0,"Results":null,"ErrorCode":0}]}

Error Message:MemberID 1000XXXXX does not have access to ClientID: ID[10000XXXX]

MemberID 1000XXXXX is my Child BU where the code is running
ClientID: ID[10000XXXX] is the Parent BU

Question: Does the WSProxy impersonate the parent BU from a Child BU or that’s not possible (it’s not mentioned in the documentation)?
Am I missing something?

Note: I tested to run my code at the Parent Level and impersonate the Child BU and the code was running successfully.

Answer

Attribution
Source : Link , Question Author : Bechir , Answer Author : Community

Leave a Comment