web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

SetBusinessSystemUser Web API call failure

(0) ShareShare
ReportReport
Posted on by 10

Hi all, 

I'm testing some actions using the WebAPI using both Postman and a test app. I'm seeing two different results. The Postman call to the web api works. The app's PostAsync fails with an error of "An error occurred while validating input parameters: Microsoft.OData.ODataException: The parameter 'ReassignPrinciple' in the request payload is not a valid parameter for the operation 'SetBusinessSystemUser'.

I've verified the values are the same for both calls. I'm obviously missing something here and just not seeing the difference.

Postman call

{{webapiurl}}/systemusers({{systemuserid}})/Microsoft.Dynamics.CRM.SetBusinessSystemUser
Postman body
{
    "BusinessUnit": {
        "businessunitid""{{targetbusinessunit}}",
        "@odata.type""Microsoft.Dynamics.CRM.businessunit"
    },
    "ReassignPrincipal": {
        "systemuserid""{{systemuserid}}",
        "@odata.type""Microsoft.Dynamics.CRM.systemuser"
    }
}

test app code: 

JObject businessUnit = JObject.Parse(@"{businessunitid: '" + businessUnitId + @"', '@odata.type': 'Microsoft.Dynamics.CRM.businessunit' }");
JObject reassignPrinciple = JObject.Parse(@"{systemuserid: '" + systemUserId + @"', '@odata.type': 'Microsoft.Dynamics.CRM.systemuser' }");

JObject bodyJson = new JObject()
{
{"BusinessUnit", businessUnit },
{"ReassignPrinciple", reassignPrinciple }
};

var stringContent = new StringContent(bodyJson.ToString(), System.Text.Encoding.UTF8, "application/json");
stringContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");

var response = await _httpClient.PostAsync($"systemusers({systemUserId})/Microsoft.Dynamics.CRM.SetBusinessSystemUser", stringContent);

test app body string:

"{\r\n \"BusinessUnit\": {\r\n \"businessunitid\": \"a450c60b-345c-eb11-a812-000d3a8a8e8c\",\r\n \"@odata.type\": \"Microsoft.Dynamics.CRM.businessunit\"\r\n },\r\n \"ReassignPrinciple\": {\r\n \"systemuserid\": \"51ca36a1-600e-eb11-a814-000d3a8dfcac\",\r\n \"@odata.type\": \"Microsoft.Dynamics.CRM.systemuser\"\r\n }\r\n}"

Any help is appreciated. Thanks in advance.

I have the same question (0)
  • Suggested answer
    davew-d365 Profile Picture
    10 on at

    Found the error. The object is "ReassignPrincipal" not "ReassignPrinciple".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans