Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JGraph
>
Tutorial
> Create TodoTask
The following example creates a TodoTask in the specified task list.
import com.independentsoft.graph.ContentType; import com.independentsoft.graph.GraphClient; import com.independentsoft.graph.GraphException; import com.independentsoft.graph.ItemBody; import com.independentsoft.graph.todo.TodoTask; import com.independentsoft.graph.todo.TodoTaskList; public class Console { 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"); java.util.List
todoTaskLists = client.getTodoTaskLists(); for (TodoTaskList list : todoTaskLists) { if(list.getDisplayName().equals("Tasks")) { TodoTask newTask = new TodoTask(); newTask.setTitle("New Task"); newTask.setBody(new ItemBody("Body text", ContentType.TEXT)); TodoTask createdTodoTask = client.createTodoTask(list.getId(), newTask); } } } catch (GraphException e) { System.out.println(e.getCode()); System.out.println(e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*