Skip to content

API Gender

Elena edited this page Apr 5, 2021 · 6 revisions

Table of Contents

Description

Genders for UI panels in different languages for the TaskTracker plugin. male and female are already added, with labels (denotation) in English and Russian.

You can add genders and change gender denotations in existing languages via API. Alternatively, you can change genders by editing your genders config file directly and then regenerating the database.

Model

Field Type Description
key String Gender key. Must be unique.
{lng_key} String Gender label in the language specified by the interface language key (en, ru, de, and others). For example, en stands for a gender label in English.

Public fields

Field Type Description
key String Gender key. Must be unique.
translation Array Gender labels in different languages. See a response example below.

Available languages:

  • en - English
  • ru - Russian

Response example

{
    "key": "male",
    "translation": 
    [
      { "key":"en" },
      "Male",
      { "key":"ru" },
      "Мужской"
    ]
}

Operations

Create a gender

Operation

Endpoint Method Description
/api/gender POST Create a new gender for the user survey in the database.

Request parameters

Parameter Type Description
key String Key of the gender. Must be unique in the database.
descriptions Array Denotation for the gender in different languages.

Request example

{
  "key": "male",
  "descriptions": 
  [
    {
      "language": "en",
      "value": "Male"
    },
    {
      "language": "ru",
      "value": "Мужской"
    }
  ]
}

Response

Public fields of the gender.


Get genders

Operation

Endpoint Method Description
/api/gender/all GET Get all genders.

Request parameters

Empty body.

Response

List of genders. Each gender has the public fields of the gender model.


Get a gender

Operation

Endpoint Method Description
/api/gender/:key GET Get gender denotations in different languages by the gender key.

Request parameters

Empty body.

Response

Public fields of the gender.


Delete a gender

Operation

Endpoint Method Description
/api/gender/:key DELETE Delete a gender by its key.

Request parameters

Empty body.

Response

Public fields of the gender.