Find

Overview of taxonomy find method

Find

GET https://api.codemash.io/:version/db/taxonomies/:taxonomyName/terms

Gets many terms by using a filter. This endpoint accepts GET and POST methods.

Path Parameters

NameTypeDescription

version

string

A version of the API endpoint.

taxonomyName

string

The name of taxonomy to get records from.

Query Parameters

NameTypeDescription

filter

string

Filter document. This allows you to find records by a custom filter. More about filters follow the link below.

cultureCode

string

Language code. If your terms have translatable fields, those fields will only include this specified language. If not provided, will take language from the Accept-Language header.

sort

string

Sort document. This allows you to sort your records. More about sorting follow the link below.

projection

string

Projection document. This allows you to specify what fields to return decreasing the amount of data transferred. This is applied to the Meta field. More about projections follow the link below.

pageSize

integer

Amount of terms to return.

pageNumber

integer

The page to return. More about paging follow the link below.

includeTaxonomy

boolean

Includes taxonomy to the response.

excludeCulture

boolean

Culture code or Accept-Language header will be used for translatable fields. If you want to get values in all languages, set this as true.

Headers

NameTypeDescription

Authorization

string

Secret API key which belongs to your project or user. Not required if using cookies with a session ID.

x-cm-projectid

string

Your project's ID. Can be passed as a query parameter.

{
    "result": [
        {
            "_id" : ObjectId("5e4faae1eda13b4b9c4b5ab9"),
            "createdOn" : ISODate("2020-01-01T12:00:00.000Z"),
            "modifiedOn" : ISODate("2020-01-01T12:00:00.000Z"),
            "taxonomyId" : ObjectId("5e4faaa5eda13b4b9c4b5ab8"),
            "taxonomyName" : "countries",
            "name" : {
                "en" : "Eswatini",
            },
            "description" : {
                "en" : "Country in Africa",
            },
            "order" : 1,
            "parentId" : ObjectId("5e4faae1eda13b4b9c4b5ab2"),
            "dependencies" : {
                "5e4faae1eda13b4b9c4b5ab2": [
                    ObjectId("5e4faae1eda13b4b9c4b5ab3"),
                    ObjectId("5e4faae1eda13b4b9c4b5ab4"),
                ]
            },
            "meta" : "{ \"text\" : \"Meta_Text\" }"
        }
    ],
    "totalCount": 1,
    "taxonomy": null,
}
var client = new CodeMashClient(apiKey, projectId);
var service = new CodeMashRepository<Person>(client);

var persons = await service.FindAsync(
    x => true,
    new DatabaseFindOptions()
);

Check the docs about entities on how the response records are deserialized into your class objects.

Check the docs on how to form projections, filters, sorting, paging. Check the docs on how to use references.

Last updated