Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
JGraph
>
Tutorial
> Create Outlook category
The following example shows you how to create an Outlook category.
import com.independentsoft.graph.GraphClient; import com.independentsoft.graph.GraphException; import com.independentsoft.graph.UserId; import com.independentsoft.graph.mails.OutlookCategory; import com.independentsoft.graph.mails.OutlookCategoryColor; public class Sample { public static void main(String[] args) { try { GraphClient client = new GraphClient(); client.setClientId("63333333-209e-454e-b7bd-55a4d201270f"); client.setTenant("independentsoft.onmicrosoft.com"); client.setUsername("info@independentsoft.onmicrosoft.com"); client.setPassword("password"); OutlookCategory category = new OutlookCategory("Important", OutlookCategoryColor.RED); OutlookCategory newCategory = client.createOutlookCategory(category, new UserId("info@independentsoft.onmicrosoft.com")); System.out.println("Id = " + newCategory.getId()); System.out.println("DisplayName = " + newCategory.getDisplayName()); System.out.println("Color = " + newCategory.getColor()); } catch (GraphException e) { System.out.println("Error: " + e.getCode()); System.out.println("Message: " + e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*