Taxonomy term API object

In Opigno Enterprise API, taxonomy term is represented by a Term object with the following parameters:
ParameterTypeDescription
idIDRequired. The taxonomy term ID.
nameStringRequired. The term name (label).
weightIntRequired. Determines the order or priority of the taxonomy term.
parentTermOptional. The parent term, if it’s set.
vocabularyStringA machine name of the corresponding taxonomy vocabulary.
Opigno Enterprise API provides two options to get a single taxonomy term data.

Get term by ID

If you know the exact ID of the term, you can call getTaxonomyTerm query to retrieve the information about the taxonomy term. Access policy:
  • The API user context should have permission to view the taxonomy term with the given ID.
The only argument that is used in the mutation is termId (required). If the term with the given ID exists, it will be returned.
query getTaxonomyTerm {
  getTaxonomyTerm(termId: "9") {
    id
    name
    parent {
      id
      name
    }
    vocabulary
    weight
  }
}

Get term by name

If you don’t know an ID of the needed term, it can be found by the name.
Note: query condition is ”=” not “LIKE”. It means that it will search for the list of terms with exactly the same name that is provided in the request.
Query arguments:
ArgumentTypeDescription
nameStringRequired. The term name (label) to search by.
vocabularyIDA machine name of the vocabulary. Can be used to limit the search results.
The query will return the list of terms which name is exactly the same as provided.
query getTaxonomyTermByName {
  getTaxonomyTermByName(name: "Onboarding", vocabulary: "lp_domain") {
    id
    name
    parent {
      id
      name
    }
    vocabulary
    weight
  }
}