1. Clients

Taxonomy client

A taxonomy contains values that you can associate with content in order to categorize items into groups. The following methods are available for taxonomies.

MethodDescription
GET /api/content/v1/taxonomiesRetrieves all taxonomies, including the name and ID as well as the properties of associated taxonomy values.
POST /api/content/v1/taxonomiesCreates a taxonomy.
GET /api/content/v1/taxonomies/<TAXONOMY_ID>Retrieves a specific taxonomy.
PUT /api/content/v1/taxonomies/<TAXONOMY_ID>Updates a specific taxonomy.
DELETE /api/content/v1/taxonomies/<TAXONOMY_ID>Deletes a specific taxonomy.

The following example illustrates these methods:

public interface ITaxonomyClient
{
  // POST /api/content/v1/taxonomies
  Task<Taxonomy> CreateAsync(
    Taxonomy taxonomy,
    CancellationToken cancellationToken = default);

  // PUT /api/content/v1/taxonomies/<TAXONOMY_ID>
  Task<Taxonomy> UpdateAsync(
    Taxonomy taxonomy,
    CancellationToken cancellationToken = default);

  // DELETE /api/content/v1/taxonomies/<TAXONOMY_ID>
  Task DeleteAsync(
    string taxonomyId,
    CancellationToken cancellationToken = default);

  // GET /api/content/v1/taxonomies
  Task<PagedResponse<Taxonomy>> GetAsync(
    TaxonomySearchRequest? searchRequest = null,
    CancellationToken cancellationToken = default);

  // Same as GetAsync, but processing the results as an enumerator.
  IAsyncEnumerable<Taxonomy> EnumerateAsync(
    TaxonomySearchRequest? searchRequest = null,
    CancellationToken cancellationToken = default);

  // GET /api/content/v1/taxonomies/<TAXONOMY_ID>
  Task<Taxonomy?> SingleAsync(
    string taxonomyId,
    CancellationToken cancellationToken = default);

  // GET /api/content/v1/taxonomies/<TAXONOMY_ID>
  // Same as SingleAsync above, but with client-side caching.
  Task<Taxonomy?> SingleCachedAsync(
    string taxonomyId,
    CancellationToken cancellationToken = default);
}
Taxonomy Client (Javascript)
export interface ITaxonomyClient {
 /**
  * POST /api/content/v1/taxonomies
  */
 createAsync(
  taxonomy: Taxonomy,
  cancelToken?: CancelToken
 ): Promise<Nullable<Taxonomy>>;

 /**
  * PUT /api/content/v1/taxonomies/<TAXONOMY_ID>
  */
 updateAsync(
  taxonomy: Taxonomy,
  cancelToken?: CancelToken
 ): Promise<Nullable<Taxonomy>>;

 /**
  * DELETE /api/content/v1/taxonomies/<TAXONOMY_ID>
  */
 deleteAsync(taxonomyId: string, cancelToken?: CancelToken): Promise<void>;

 /**
  * GET /api/content/v1/taxonomies
  */
 getAsync(
  searchRequest?: Nullable TaxonomySearchRequest>,
  cancelToken?: CancelToken
 ): Promise<PagedResponse<Taxonomy>;

 /**
  * GET /api/content/v1/taxonomies/<TAXONOMY_ID>
  */
 singleAsync(
  taxonomyId: string,
  cancelToken?: CancelToken
 ): Promise<Nullable<Taxonomy>>;

 /**
  * GET /api/content/v1/taxonomies/<taxonomyId>
  * Same as SingleAsync above, but with client-side caching.
  */
 singleCachedAsync(
  taxonomyId: string,
  cancelToken?: CancelToken
 ): Promise<Nullable<Taxonomy>>;

 /**
  * Same as getAsync, but processing the results as an enumerator.
  */
 enumerate(
  searchRequest?: TaxonomySearchRequest,
  cancelToken?: CancelToken
 ): Promise<Array<Taxonomy>>;
}
If you have suggestions for improving this article, let us know!