C# Dynamics CRM: Get System Users

Back to Index

Gets information about each systemuser.

Documentation: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/systemuser?view=dynamics-ce-odata-9

CURL Command

curl -X GET https://my-dynamics-domain.api.crm.dynamics.com/api/data/v9.0/systemusers \
  -d "$select=fullname,title,caltype" \
  -H "Accept: application/json" \
  -H "OData-MaxVersion: 4.0"  \
  -H "OData-Version: 4.0" \
  -H "Authorization: Bearer DYNAMICS_CRM_ACCESS_TOKEN"

C# Example

Chilkat.Rest rest = new Chilkat.Rest();
bool success;

//  URL: https://my-dynamics-domain.api.crm.dynamics.com/api/data/v9.0/systemusers
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = rest.Connect("my-dynamics-domain.api.crm.dynamics.com",port,bTls,bAutoReconnect);
if (success != true) {
    Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
    Debug.WriteLine(rest.LastErrorText);
    return;
}

rest.AddQueryParam("$select","fullname,title,caltype");

rest.AddHeader("OData-MaxVersion","4.0");
rest.AddHeader("Accept","application/json");
rest.AddHeader("OData-Version","4.0");
rest.AddHeader("Authorization","Bearer DYNAMICS_CRM_ACCESS_TOKEN");

Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
success = rest.FullRequestNoBodySb("GET","/api/data/v9.0/systemusers",sbResponseBody);
if (success != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}

int respStatusCode = rest.ResponseStatusCode;
if (respStatusCode >= 400) {
    Debug.WriteLine("Response Status Code = " + Convert.ToString(respStatusCode));
    Debug.WriteLine("Response Header:");
    Debug.WriteLine(rest.ResponseHeader);
    Debug.WriteLine("Response Body:");
    Debug.WriteLine(sbResponseBody.GetAsString());
    return;
}

Chilkat.JsonObject jsonResponse = new Chilkat.JsonObject();
jsonResponse.LoadSb(sbResponseBody);

int i;
int count_i;

string odataContext = jsonResponse.StringOf("\"@odata.context\"");
i = 0;
count_i = jsonResponse.SizeOfArray("value");
while (i < count_i) {
    jsonResponse.I = i;
    string odataEtag = jsonResponse.StringOf("value[i].\"@odata.etag\"");
    string fullname = jsonResponse.StringOf("value[i].fullname");
    string title = jsonResponse.StringOf("value[i].title");
    int caltype = jsonResponse.IntOf("value[i].caltype");
    string systemuserid = jsonResponse.StringOf("value[i].systemuserid");
    string ownerid = jsonResponse.StringOf("value[i].ownerid");
    i = i + 1;
}

Sample JSON Response Body

{
  "@odata.context": "https://mydomain.api.crm.dynamics.com/api/data/v9.0/$metadata#systemusers(fullname,title,caltype)",
  "value": [
    {
      "@odata.etag": "W/\"1175958\"",
      "fullname": "Provisioning User",
      "title": null,
      "caltype": 1,
      "systemuserid": "a1ef4f70-e325-e811-a967-000d3a161089",
      "ownerid": "a1ef4f70-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175965\"",
      "fullname": "Provisioning User",
      "title": null,
      "caltype": 1,
      "systemuserid": "dd354976-e325-e811-a967-000d3a161089",
      "ownerid": "dd354976-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175972\"",
      "fullname": "Provisioning User",
      "title": null,
      "caltype": 1,
      "systemuserid": "08364976-e325-e811-a967-000d3a161089",
      "ownerid": "08364976-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175979\"",
      "fullname": "Provisioning User",
      "title": null,
      "caltype": 1,
      "systemuserid": "48c9687c-e325-e811-a967-000d3a161089",
      "ownerid": "48c9687c-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175986\"",
      "fullname": "Provisioning User",
      "title": null,
      "caltype": 1,
      "systemuserid": "5fc9687c-e325-e811-a967-000d3a161089",
      "ownerid": "5fc9687c-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175919\"",
      "fullname": "Allie Bellew",
      "title": "Marketing Manager",
      "caltype": 7,
      "systemuserid": "0d3d7b82-e325-e811-a967-000d3a161089",
      "ownerid": "0d3d7b82-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175915\"",
      "fullname": "Alan Steiner",
      "title": "VP Corporate Marketing",
      "caltype": 7,
      "systemuserid": "2d3d7b82-e325-e811-a967-000d3a161089",
      "ownerid": "2d3d7b82-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175917\"",
      "fullname": "Alicia Thomber",
      "title": "Chief Financial Officer",
      "caltype": 7,
      "systemuserid": "533d7b82-e325-e811-a967-000d3a161089",
      "ownerid": "533d7b82-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175921\"",
      "fullname": "Amy Alberts",
      "title": "VP Human Resources",
      "caltype": 7,
      "systemuserid": "927d9388-e325-e811-a967-000d3a161089",
      "ownerid": "927d9388-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175923\"",
      "fullname": "Anne Weiler",
      "title": "Manufacturing Lead",
      "caltype": 7,
      "systemuserid": "a97d9388-e325-e811-a967-000d3a161089",
      "ownerid": "a97d9388-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175907\"",
      "fullname": "Spencer Low",
      "title": "Territory Sales Manager",
      "caltype": 7,
      "systemuserid": "461b928e-e325-e811-a967-000d3a161089",
      "ownerid": "461b928e-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175925\"",
      "fullname": "Carlos Grilo",
      "title": "Customer Call Center Manager",
      "caltype": 7,
      "systemuserid": "841b928e-e325-e811-a967-000d3a161089",
      "ownerid": "841b928e-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175933\"",
      "fullname": "Diane Prescott",
      "title": "Advertising Director",
      "caltype": 7,
      "systemuserid": "600f8d94-e325-e811-a967-000d3a161089",
      "ownerid": "600f8d94-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175949\"",
      "fullname": "Molly Clark",
      "title": "Sales Account Manager",
      "caltype": 7,
      "systemuserid": "b10f8d94-e325-e811-a967-000d3a161089",
      "ownerid": "b10f8d94-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175927\"",
      "fullname": "Christa Geller",
      "title": "Recruiting Coordinator",
      "caltype": 7,
      "systemuserid": "703c5ea7-e325-e811-a967-000d3a161089",
      "ownerid": "703c5ea7-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175931\"",
      "fullname": "David So",
      "title": "Manufacturing Manager",
      "caltype": 7,
      "systemuserid": "a60c58ad-e325-e811-a967-000d3a161089",
      "ownerid": "a60c58ad-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175913\"",
      "fullname": "Veronica Quek",
      "title": "Sales Representative",
      "caltype": 7,
      "systemuserid": "0fa151b3-e325-e811-a967-000d3a161089",
      "ownerid": "0fa151b3-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175929\"",
      "fullname": "Dan Jump",
      "title": "Chief Executive Officer",
      "caltype": 7,
      "systemuserid": "227b58b9-e325-e811-a967-000d3a161089",
      "ownerid": "227b58b9-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175947\"",
      "fullname": "Kelly Krout",
      "title": "Public Relations Representative",
      "caltype": 7,
      "systemuserid": "6795b1bf-e325-e811-a967-000d3a161089",
      "ownerid": "6795b1bf-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175911\"",
      "fullname": "Ty Carlson",
      "title": "Chief Operations Officer",
      "caltype": 7,
      "systemuserid": "dd60acc5-e325-e811-a967-000d3a161089",
      "ownerid": "dd60acc5-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175943\"",
      "fullname": "Julian Isla",
      "title": "VP Sales Operations",
      "caltype": 7,
      "systemuserid": "9318cccb-e325-e811-a967-000d3a161089",
      "ownerid": "9318cccb-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175909\"",
      "fullname": "Sven Mortensen",
      "title": "Sales Representative",
      "caltype": 7,
      "systemuserid": "ae56dbd1-e325-e811-a967-000d3a161089",
      "ownerid": "ae56dbd1-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175935\"",
      "fullname": "Eric Gruber",
      "title": "Director of Finance",
      "caltype": 7,
      "systemuserid": "d556dbd1-e325-e811-a967-000d3a161089",
      "ownerid": "d556dbd1-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175937\"",
      "fullname": "Greg Winston",
      "title": "VP of IT",
      "caltype": 7,
      "systemuserid": "9460fbd7-e325-e811-a967-000d3a161089",
      "ownerid": "9460fbd7-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175953\"",
      "fullname": "Sanjay Shah",
      "title": "Sales Representative",
      "caltype": 7,
      "systemuserid": "e260fbd7-e325-e811-a967-000d3a161089",
      "ownerid": "e260fbd7-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175951\"",
      "fullname": "Renee Lo",
      "title": "Director of IT",
      "caltype": 7,
      "systemuserid": "f73910de-e325-e811-a967-000d3a161089",
      "ownerid": "f73910de-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175945\"",
      "fullname": "Karen Berg",
      "title": "VP Operations and Business Strategy",
      "caltype": 7,
      "systemuserid": "2f3a10de-e325-e811-a967-000d3a161089",
      "ownerid": "2f3a10de-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175939\"",
      "fullname": "Jamie Reding",
      "title": "Customer Service Representative",
      "caltype": 7,
      "systemuserid": "140223e4-e325-e811-a967-000d3a161089",
      "ownerid": "140223e4-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1175941\"",
      "fullname": "Jeff Hay",
      "title": "Chief Information Officer",
      "caltype": 7,
      "systemuserid": "5d3448ea-e325-e811-a967-000d3a161089",
      "ownerid": "5d3448ea-e325-e811-a967-000d3a161089"
    },
    {
      "@odata.etag": "W/\"1053304\"",
      "fullname": "Support User",
      "title": null,
      "caltype": 0,
      "systemuserid": "664811d2-2225-e811-a965-000d3a161ff6",
      "ownerid": "664811d2-2225-e811-a965-000d3a161ff6"
    },
    {
      "@odata.etag": "W/\"1053568\"",
      "fullname": "Delegated Admin",
      "title": null,
      "caltype": 0,
      "systemuserid": "714811d2-2225-e811-a965-000d3a161ff6",
      "ownerid": "714811d2-2225-e811-a965-000d3a161ff6"
    },
    {
      "@odata.etag": "W/\"1066457\"",
      "fullname": "Molly Clark (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "91e724e4-0f9e-434f-8e6e-070c7beb8d4a",
      "ownerid": "91e724e4-0f9e-434f-8e6e-070c7beb8d4a"
    },
    {
      "@odata.etag": "W/\"1066464\"",
      "fullname": "Allie Bellew (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "832698d1-b86a-47b5-a9a3-0cc710eb22e4",
      "ownerid": "832698d1-b86a-47b5-a9a3-0cc710eb22e4"
    },
    {
      "@odata.etag": "W/\"949364\"",
      "fullname": "SYSTEM",
      "title": null,
      "caltype": 0,
      "systemuserid": "67babf91-7849-416f-ab7f-0e50e1ce4999",
      "ownerid": "67babf91-7849-416f-ab7f-0e50e1ce4999"
    },
    {
      "@odata.etag": "W/\"1066471\"",
      "fullname": "Kelly Krout (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "32ff7175-0dbe-4acb-872e-22f86435bf98",
      "ownerid": "32ff7175-0dbe-4acb-872e-22f86435bf98"
    },
    {
      "@odata.etag": "W/\"1066478\"",
      "fullname": "Ty Calrson (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "aae44934-cb43-46a7-a032-3e557970fd0e",
      "ownerid": "aae44934-cb43-46a7-a032-3e557970fd0e"
    },
    {
      "@odata.etag": "W/\"1066485\"",
      "fullname": "Anne Weiler (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "1c583537-cbe8-42d2-b32b-42ed9418ed3b",
      "ownerid": "1c583537-cbe8-42d2-b32b-42ed9418ed3b"
    },
    {
      "@odata.etag": "W/\"1066492\"",
      "fullname": "Jeff Hay (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "81c8d6a8-a676-4712-9121-4841328f2ba2",
      "ownerid": "81c8d6a8-a676-4712-9121-4841328f2ba2"
    },
    {
      "@odata.etag": "W/\"1066501\"",
      "fullname": "Renee Lo (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "8f8456f3-2adb-40a3-999a-531414afec16",
      "ownerid": "8f8456f3-2adb-40a3-999a-531414afec16"
    },
    {
      "@odata.etag": "W/\"1066508\"",
      "fullname": "Karen Berg (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "2be8c45d-384d-4ecc-aeb9-5992f4d7bf56",
      "ownerid": "2be8c45d-384d-4ecc-aeb9-5992f4d7bf56"
    },
    {
      "@odata.etag": "W/\"1066515\"",
      "fullname": "Alan Steiner (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "de204697-5390-4cbf-8650-6d72c8d46d13",
      "ownerid": "de204697-5390-4cbf-8650-6d72c8d46d13"
    },
    {
      "@odata.etag": "W/\"1066522\"",
      "fullname": "Veronica Quek (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "1aaf42bf-2470-4495-a7b0-739e422ecd11",
      "ownerid": "1aaf42bf-2470-4495-a7b0-739e422ecd11"
    },
    {
      "@odata.etag": "W/\"1066529\"",
      "fullname": "Sanjay Shaw (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "e9d14f03-d7ac-4ad1-8f3d-7cdf1cb5bed8",
      "ownerid": "e9d14f03-d7ac-4ad1-8f3d-7cdf1cb5bed8"
    },
    {
      "@odata.etag": "W/\"1066536\"",
      "fullname": "David So (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "08db2dd6-1ad1-4ab7-90bf-8258d861fb29",
      "ownerid": "08db2dd6-1ad1-4ab7-90bf-8258d861fb29"
    },
    {
      "@odata.etag": "W/\"1066544\"",
      "fullname": "Greg Winston (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "640624c1-04d8-4f9d-be9e-9053b447762c",
      "ownerid": "640624c1-04d8-4f9d-be9e-9053b447762c"
    },
    {
      "@odata.etag": "W/\"1066551\"",
      "fullname": "Sven Mortensen (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "e72f3351-5039-425c-b632-907fcd1ea1a3",
      "ownerid": "e72f3351-5039-425c-b632-907fcd1ea1a3"
    },
    {
      "@odata.etag": "W/\"1066558\"",
      "fullname": "Eric Gruber (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "7a32b36e-2ae6-462e-8d4f-941888721dda",
      "ownerid": "7a32b36e-2ae6-462e-8d4f-941888721dda"
    },
    {
      "@odata.etag": "W/\"1066565\"",
      "fullname": "Demo User",
      "title": null,
      "caltype": 0,
      "systemuserid": "6ea9d6c4-e364-466a-ae93-94239059046a",
      "ownerid": "6ea9d6c4-e364-466a-ae93-94239059046a"
    },
    {
      "@odata.etag": "W/\"1066572\"",
      "fullname": "Christa Geller (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "0d30c450-9ccb-486f-8842-9b4136b0e54b",
      "ownerid": "0d30c450-9ccb-486f-8842-9b4136b0e54b"
    },
    {
      "@odata.etag": "W/\"1770011\"",
      "fullname": "MOD Administrator",
      "title": null,
      "caltype": 7,
      "systemuserid": "e00ba668-e2de-47bc-8f92-ab9573f92ff4",
      "ownerid": "e00ba668-e2de-47bc-8f92-ab9573f92ff4"
    },
    {
      "@odata.etag": "W/\"1066579\"",
      "fullname": "--- ---",
      "title": null,
      "caltype": 0,
      "systemuserid": "5f05580c-d097-4448-8c92-b58ef567ef8d",
      "ownerid": "5f05580c-d097-4448-8c92-b58ef567ef8d"
    },
    {
      "@odata.etag": "W/\"1066586\"",
      "fullname": "Spencer Low (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "04773a56-53ed-4d76-a22f-d0616a23e210",
      "ownerid": "04773a56-53ed-4d76-a22f-d0616a23e210"
    },
    {
      "@odata.etag": "W/\"1066593\"",
      "fullname": "Jamie Reding (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "55e68414-a277-42d6-ba36-d90484708a1d",
      "ownerid": "55e68414-a277-42d6-ba36-d90484708a1d"
    },
    {
      "@odata.etag": "W/\"1066600\"",
      "fullname": "Alicia Thomber (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "553268fb-baca-4bc5-9d97-ee14d9980888",
      "ownerid": "553268fb-baca-4bc5-9d97-ee14d9980888"
    },
    {
      "@odata.etag": "W/\"1066607\"",
      "fullname": "Dan Jump (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "436311de-eece-4438-a8a5-eeed4bb5269b",
      "ownerid": "436311de-eece-4438-a8a5-eeed4bb5269b"
    },
    {
      "@odata.etag": "W/\"949365\"",
      "fullname": "INTEGRATION",
      "title": null,
      "caltype": 0,
      "systemuserid": "08d23a2b-6b87-475b-b879-f1dd5128de57",
      "ownerid": "08d23a2b-6b87-475b-b879-f1dd5128de57"
    },
    {
      "@odata.etag": "W/\"1066614\"",
      "fullname": "Julian Isla (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "365be230-b185-45cd-aded-f7e5e2c72554",
      "ownerid": "365be230-b185-45cd-aded-f7e5e2c72554"
    },
    {
      "@odata.etag": "W/\"1066621\"",
      "fullname": "Diane Prescott (Sample Data)",
      "title": null,
      "caltype": 0,
      "systemuserid": "97b16748-0df7-43ab-ad6f-fb83a6b8ad07",
      "ownerid": "97b16748-0df7-43ab-ad6f-fb83a6b8ad07"
    }
  ]
}