Is it possible to create a term template using REST API?

Ali 15 Reputation points
2023-03-16T15:56:09.65+00:00

Is it possible to create term templates in Purview using REST APIs?

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
948 questions
{count} votes

2 answers

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 78,331 Reputation points Microsoft Employee
    2023-03-20T09:01:42.9766667+00:00


    Ali
    - Thanks for the question and using MS Q&A platform.

    Yes, it is possible to create term templates in Microsoft Purview using REST APIs.

    To create a term template, you can use the "Create Term Template" REST API endpoint in the Purview API. Here's an example of how to create a term template using the REST API:

    1. Get an OAuth2 access token: To call the Purview API, you need to obtain an access token using OAuth2 authentication. You can obtain an access token by sending a request to the Azure Active Directory token endpoint.
    2. Create a term template JSON payload: You need to create a JSON payload that defines the properties of the term template you want to create. Here's an example of a JSON payload for a term template:
    {
      "name": "MyTermTemplate",
      "description": "This is a sample term template.",
      "terms": [
        {
          "name": "Term1",
          "description": "This is the first term.",
          "isSystem": false
        },
        {
          "name": "Term2",
          "description": "This is the second term.",
          "isSystem": false
        }
      ]
    }
    
    
    1. Call the "Create Term Template" API endpoint: You can use the HTTP POST method to call the "Create Term Template" API endpoint and pass the JSON payload in the request body. Here's an example of the API endpoint URL:

    https://{accountname}.catalog.purview.azure.com/api/atlas/v2/types/termTemplate/definition

    Note that you need to replace "{accountname}" with the name of your Purview account.

    1. Verify the response: If the term template is created successfully, the API endpoint returns a response with the status code 201 (Created) and the JSON payload of the created term template.

    For more details, refer to Microsoft Purview - REST API.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


  2. Cayir Aydar, Aysegul 0 Reputation points
    2023-07-18T09:32:25.25+00:00

    @Ali could you solve your problem? I try to do same thing.

    0 comments No comments