Example - finding terms
If a term was identified that should be avoided, it might be interesting to retrieve other terms of the same entry which could be used instead.
Via the term, it is possible to retrieve its entry:
api/v1/Terms(key)/Entry
To retrieve all terms of the same entry, use:
api/v1/Entries(key)/Terms
This way, terms of the same language can be identified that are not discouraged (do not have DoNotUse).
For example, if we found "shoe lace" via search (see below for search), we could retrieve its entry via api/v1/Terms(key)/Entry, and in the example above we would receive ID 1 for this entry. From there on, requesting api/v1/Entries(1)/Terms will return all terms, including "shoe lace" and "shoe string" in English and "Schnürband" and "Schnürsenkel" in German. Their properties can again be found via api/v1/Terms(key)/Properties.
Usage of the $expand parameter
Instead of chaining several requests, as in the explanation above, these queries may be abbreviated with the $expand parameter. The following examples illustrate its usage:
To retrieve an entry with all its terms by term id (key) of one of the entry's terms:
GET api/v1/Terms(key)/Entry?$expand=Terms
Same as before, including properties of the entry and of all terms:
GET api/v1/Terms(key)/Entry?$expand=Properties,Terms/Properties
To retrieve all terms of an entry along with their properties:
GET api/v1/Entries(key)/Terms?$expand=Properties
SearchTerms
To search for a set of strings in crossTerm and receive the matching terms (if any are present) from the crossTerm database.
Example: The term "opacity" exists in crossTerm. A request to SearchTerms with the Terms parameter set to 'opacity' returns the term "opacity".
For a technical description, see crossTerm API documentation under Terms/SearchTerms.
WildcardSearch
To search for a string with a wildcard and receive the matching terms (if any are present) from the crossTerm database.
Example: The terms "opacity" and "opaque" exist in crossTerm. A request to WildcardSearch with the Query parameter set to 'opa*' returns the terms "opacity" and "opaque".
For a technical description, see crossTerm API documentation under Terms/WildcardSearch.
SearchTermsInText
To search terms in a provided text fragment and receive the matching terms (if any are present) from the crossTerm database.
Example: The terms "opacity" and "opaque" exist in crossTerm. A request to SearchTermsInText with the TextFragment parameter set to 'The noun related to opaque is opacity.' returns the terms "opaque" and "opacity" along with their ranges in the submitted string.
For a technical description, see crossTerm API documentation under Terms/SearchTermsInText.
Usage of $expand parameter
Here as well, the $expand parameter may be used to prevent multiple requests. For example, to retrieve source terms with translations via SearchTerms:
POST api/v1/SearchTerms?$expand=Results/Entry/Terms
And also with WildcardSearch:
POST api/v1/Terms/WildcardSearch?$expand=Entry/Terms