10. Dezember 2021

· Whitepaper

GetAccounts

Inhaltsverzeichnis

xx Kapitel

Auslesen der verfügbaren Mandanten

RequestParameter: GetAccountsRequest
ResponseParameter: GetAccountsResponse

Die Methode GetAccounts liefert die für den aktuellen Benutzer verfügbaren Mandanten.
Bis auf den SecurityContext sind beim Request keine weiteren Angaben nötig. Die Methode liefert ein GetAccountsResponse-Objekt, welches ein Array von Mandanten beinhaltet. Jedes Element repräsentiert einen verfügbaren Mandanten des aktuellen Benutzers.

Beispiel Request „Auslesen Mandanten“

C#

MailworxWebServiceAgent agent = new MailworxWebServiceAgent();
GetAccountsRequest request = new GetAccountsRequest();
//Set the auth. Information
request.SecurityContext = GetSecurityContext();

GetAccountsResponse response = agent.GetAccounts(request);
//The current user has access to the following accounts.
foreach (Account acc in response.Accounts) {
	Console.WriteLine("{0} ({1})", acc.Name, acc.ID);
}

Need Support?

Can't find the answer you're looking for?
Contact Support