4.1 Create a New Group and Term Set

 In this example, a new group and term set is created. The term set represents a collection of conference rooms as described in section 4.

The operation is summarized in the following steps.

  1. The "Managed Metadata Service Application Proxy" TermStore object is retrieved by calling the GetByName method on the TermStoreCollection object.

  2. The CreateGroup method is called on the TermStore object to create the "Conferences" group.

  3. The CreateTermSet method is called on the TermGroup object to create the "Conference Rooms" term set.

  4. The CreateTerm method is called on the TermSet object and subsequent Term objects to construct the hierarchy of conference room terms.

Request:

 <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
   <Actions>
     <ObjectPath Id="2" ObjectPathId="1" />
     <ObjectPath Id="4" ObjectPathId="3" />
     <ObjectPath Id="6" ObjectPathId="5" />
     <ObjectPath Id="8" ObjectPathId="7" />
     <ObjectPath Id="10" ObjectPathId="9" />
     <ObjectIdentityQuery Id="11" ObjectPathId="9" />
     <ObjectPath Id="13" ObjectPathId="12" />
     <ObjectPath Id="15" ObjectPathId="14" />
     <ObjectIdentityQuery Id="16" ObjectPathId="14" />
     <ObjectPath Id="18" ObjectPathId="17" />
     <ObjectIdentityQuery Id="19" ObjectPathId="17" />
     <ObjectPath Id="21" ObjectPathId="20" />
     <ObjectIdentityQuery Id="22" ObjectPathId="20" />
     <ObjectPath Id="24" ObjectPathId="23" />
     <ObjectIdentityQuery Id="25" ObjectPathId="23" />
     <ObjectPath Id="27" ObjectPathId="26" />
     <ObjectIdentityQuery Id="28" ObjectPathId="26" />
     <ObjectPath Id="30" ObjectPathId="29" />
     <ObjectIdentityQuery Id="31" ObjectPathId="29" />
     <ObjectPath Id="33" ObjectPathId="32" />
     <ObjectIdentityQuery Id="34" ObjectPathId="32" />
     <ObjectPath Id="36" ObjectPathId="35" />
     <ObjectIdentityQuery Id="37" ObjectPathId="35" />
     <ObjectPath Id="39" ObjectPathId="38" />
     <ObjectIdentityQuery Id="40" ObjectPathId="38" />
     <ObjectPath Id="42" ObjectPathId="41" />
     <ObjectIdentityQuery Id="43" ObjectPathId="41" />
     <Method Name="CommitAll" Id="44" ObjectPathId="9" />
   </Actions>
   <ObjectPaths>
     <StaticProperty Id="1" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" />
     <Property Id="3" ParentId="1" Name="Site" />
     <Constructor Id="5" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}">
       <Parameters>
         <Parameter ObjectPathId="3" />
         <Parameter Type="Boolean">true</Parameter>
       </Parameters>
     </Constructor>
     <Property Id="7" ParentId="5" Name="TermStores" />
     <Method Id="9" ParentId="7" Name="GetByName">
       <Parameters>
         <Parameter Type="String">Managed Metadata Service Application Proxy</Parameter>
       </Parameters>
     </Method>
     <Constructor Id="12" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}">
       <Parameters>
         <Parameter ObjectPathId="3" />
         <Parameter Type="Boolean">true</Parameter>
       </Parameters>
     </Constructor>
     <Method Id="14" ParentId="9" Name="CreateGroup">
       <Parameters>
         <Parameter Type="String">Conferences</Parameter>
       </Parameters>
     </Method>
     <Method Id="17" ParentId="14" Name="CreateTermSet">
       <Parameters>
         <Parameter Type="String">Conference Rooms</Parameter>
         <Parameter Type="Guid">{e143c875-5a3c-4c38-b13f-abe2cedc1573}</Parameter>
         <Parameter Type="Int32">1033</Parameter>
       </Parameters>
     </Method>
     <Method Id="20" ParentId="17" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Auditoriums</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{63161cae-a38c-4c3b-976b-71f76506fd5b}</Parameter>
       </Parameters>
     </Method>
     <Method Id="23" ParentId="20" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Auditorium C</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{b72d8ae6-e6a6-47fe-82d8-099f070fdd37}</Parameter>
       </Parameters>
     </Method>
     <Method Id="26" ParentId="20" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Auditorium D</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{03ae29ce-739c-491b-a119-c79a5aa7fa0c}</Parameter>
       </Parameters>
     </Method>
     <Method Id="29" ParentId="20" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Auditorium E</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{984dc45a-139f-426f-b0bf-aa1cd275e024}</Parameter>
       </Parameters>
     </Method>
     <Method Id="32" ParentId="17" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Halls</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{aa770cfb-eb06-4091-9860-9fb6913a4fcf}</Parameter>
       </Parameters>
     </Method>
     <Method Id="35" ParentId="32" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Hall A</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{80938290-52b2-4713-b32d-6e55d194e2ea}</Parameter>
       </Parameters>
     </Method>
     <Method Id="38" ParentId="32" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Hall B</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{6cb787f9-5339-4024-9efc-6d8bbc24c51d}</Parameter>
       </Parameters>
     </Method>
     <Method Id="41" ParentId="32" Name="CreateTerm">
       <Parameters>
         <Parameter Type="String">Hall C</Parameter>
         <Parameter Type="Int32">1033</Parameter>
         <Parameter Type="Guid">{28e647db-becf-4caa-83ec-1a5293ce127a}</Parameter>
       </Parameters>
     </Method>
   </ObjectPaths>
 </Request>

Response:

 [
 {
 "SchemaVersion":"15.0.0.0","LibraryVersion":"15.0.3410.1000","ErrorInfo":null
 },2,{
 "IsNull":false
 },4,{
 "IsNull":false
 },6,{
 "IsNull":false
 },8,{
 "IsNull":false
 },10,{
 "IsNull":false
 },11,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:st:TKE6KUAnlkq7BYswGJADmQ=="
 },13,{
 "IsNull":false
 },15,{
 "IsNull":false
 },16,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:gr:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHQ="
 },18,{
 "IsNull":false
 },19,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:se:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVz"
 },21,{
 "IsNull":false
 },22,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVzrhwWY4yjO0yXa3H3ZQb9Ww=="
 },24,{
 "IsNull":false
 },25,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVz5oott6bm\u002fkeC2AmfBw\u002fdNw=="
 },27,{
 "IsNull":false
 },28,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVzzimuA5xzG0mhGceaWqf6DA=="
 },30,{
 "IsNull":false
 },31,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVzWsRNmJ8Tb0Kwv6oc0nXgJA=="
 },33,{
 "IsNull":false
 },34,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVz+wx3qgbrkUCYYJ+2kTpPzw=="
 },36,{
 "IsNull":false
 },37,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVzkIKTgLJSE0ezLW5V0ZTi6g=="
 },39,{
 "IsNull":false
 },40,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVz+Ye3bDlTJECe\u002fG2LvCTFHQ=="
 },42,{
 "IsNull":false
 },43,{
 "_ObjectIdentity_":"fec14c62-7c3b-481b-851b-c80d7802b224:te:TKE6KUAnlkq7BYswGJADmQGpI3ewiWBMvXAXIgOJxHR1yEPhPFo4TLE\u002fq+LO3BVz20fmKM++qkyD7BpSk84Seg=="
 }
 ]