TaxonomyClientService.AddTerms method

Adds a new Term to the managed metadata TermStore object.

Namespace:  Microsoft.SharePoint.Taxonomy.WebServices
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)


<WebMethodAttribute> _
Public Function AddTerms ( _
    sharedServiceId As Guid, _
    termSetId As Guid, _
    lcid As Integer, _
    newTerms As String _
) As String
Dim instance As TaxonomyClientService
Dim sharedServiceId As Guid
Dim termSetId As Guid
Dim lcid As Integer
Dim newTerms As String
Dim returnValue As String

returnValue = instance.AddTerms(sharedServiceId, _
    termSetId, lcid, newTerms)
public string AddTerms(
    Guid sharedServiceId,
    Guid termSetId,
    int lcid,
    string newTerms


  • sharedServiceId
    Type: System.Guid

    TermStore Id of TermSet to add Term in.

  • lcid
    Type: System.Int32

    The language that the label will be added in.

Return value

Type: System.String
ID of the newly added Term.


Exception Condition

Thrown if user does not have access to the root web of the current context.


Thrown if a TermStore with ID sharedServiceId does not exist. Also, thrown if you try to add a new Term under another Term (parentTermId is not the empty GUID), and you are trying to add to the keywords TermSet (TermSetId is the empty GUID).


Thrown if the TermSet with ID TermSetId does not exist.


Thrown if the parentTermId is not the empty GUID and the Term does not exist in the TermSet with ID TermSetId.


New Terms must be stored in XML nodes named NewTerm with an attribute label, attribute clientId and attribute parentTermid. You can have as many NewTerm nodes as needed. clientId is an int that the client used to uniquely identify the newTerm. The parentTermId must either be the GUID of another Term, or an empty GUID if the new Term should be at the root of the TermSet.

See also


TaxonomyClientService class

TaxonomyClientService members

Microsoft.SharePoint.Taxonomy.WebServices namespace