Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Graph JS
>
Tutorial
> Create list
The following example shows you how to create a new list in a site.
import { GraphClient } from '../independentsoft/graph/graph.js'; import { Group, GroupType } from '../independentsoft/graph/groups.js'; async function mainFunc() { try { const client = new GraphClient(); client.clientId = "xxxxxxxxxx-209e-454e-xxxxxxxxxxxxxxxxxxx"; client.tenant = "independentsoft.onmicrosoft.com"; client.clientSecret = "xxxxxxxxx.ONVE[=zYYxxxxxxxxxxxxxxxx"; let group = new Group(); group.displayName = "TestGroup"; group.mailEnabled = true; group.mailNickname = "TestGroup"; group.types.push(GroupType.UNIFIED); const createdGroup = await client.createGroup(group); console.log("Id = " + createdGroup.id); } catch (e) { console.error(e.code) //error code console.error(e.message) //description console.error(e.date) //timestamp console.error(e.innerError) //innerError } } mainFunc();
Need help? Ask our developers:
Name*
Email*
Message*