Skip to content

Ekilex API

Indrek Hein edited this page Mar 2, 2021 · 23 revisions

Updated 01.03.2021

Overview

  • For accessing API a security key is required. The API key can be acquired by everyone at Ekilex user profile page.
  • There may be only one API key per user. Generating new API key replaces existing one.
  • Put ekilex-api-key: cd8c61505b17423282150624463fcace into the header of API request.
  • Since each API key is associated with a particular user, all data modification actions are logged by that name.
  • CRUD operations can only be executed when either the key owner has admin rights or CRUD is granted by admin at Ekilex permissions page.
  • The same permissions granting logic applies as in Ekilex
  • API service URI-s start with "/api/**"
  • All modification services return the same JSON structure with operation success: true/false flag with explanatory message

list if all API endpoints

GET /api/endpoints

Get technical specification of each service endpoint

Data search services overview*

*there are more - see endpoints spec

list datasets

Request

GET /api/datasets

Response

Example: datasets_result.json

list classifiers

Request

GET /api/classifiers/{classifierName}

Example: /api/classifiers/MORPH

Parameters

  • classifierName - the classifier name constant. Currently exposed listings are for values:
    • LABEL_TYPE
    • LANGUAGE
    • DOMAIN
    • GOVERNMENT_TYPE
    • REGISTER
    • FREQUENCY_GROUP
    • GENDER
    • POS
    • MORPH
    • DERIV
    • WORD_TYPE
    • ETYMOLOGY_TYPE
    • MEANING_REL_TYPE
    • LEX_REL_TYPE
    • WORD_REL_TYPE
    • FORM_REL_TYPE
    • DISPLAY_MORPH
    • PROCESS_STATE
    • USAGE_AUTHOR_TYPE
    • USAGE_TYPE
    • VALUE_STATE
    • POS_GROUP
    • ASPECT
    • DEFINITION_TYPE
    • REGION
    • SEMANTIC_TYPE

Response

Example: classifiers_MORPH_result.json

list domains

GET /api/domainorigins

Response

domainorigins_result.json

GET /api/domains/{origin}

Example: /api/domains/militerm

Response

Example: domains_militerm_result.json

search words, results arranged by word

Request

GET /api/word/search/{word}

Example: /api/word/search/suuline

GET /api/word/search/{word}/{datasets}

Example: /api/word/search/suuline/psv,qq2,ss1

Parameters

  • word - word to search. Meta symbols * and ? can be applied to make less specific search
    • * - placeholder for any number of any symbols in search word
    • ? - placeholder for any one symbol in search word
  • datasets - optional. Comma delimited list of supported dataset codes. Only words with lexemes of specified datasets are retrieved or all if not specified

Response

Example: lexsearch_suuline_result.json

word details

Request

GET /api/word/details/{wordId}

Example: /api/word/details/216071

GET /api/word/details/{wordId}/{datasets}

Example: /api/word/details/216071/psv,qq2,ss1

Parameters

  • wordId - surrogate id of specific word record in Ekilex database
  • datasets - optional. Comma delimited list of supported dataset codes. Only lexemes of specified datasets are retrieved or all if not specified

Response

Example: worddetails_216071_result.json

word paradigms

GET /api/paradigm/details/{wordId}

search terms, results arranged by meaning

Request

GET /api/meaning/search/{word}

Example: /api/meaning/search/eu

GET /api/meaning/search/{word}/{datasets}

Example: /api/meaning/search/eu/est,õtb

Parameters

  • word - word to search. Meta symbols * and ? can be applied to make less specific search
    • * - placeholder for any number of any symbols in search word
    • ? - placeholder for any one symbol in search word
  • datasets - optional. Comma delimited list of supported dataset codes. Only meanings with lexemes of specified datasets are retrieved or all if not specified

Response

Example: termsearch_eu_result.json

meaning details

Request

GET /api/meaning/details/{meaningId}

Example: /api/meaning/details/384064

GET /api/meaning/details/{meaningId}/{datasets}

Example: /api/meaning/details/384064/est,õtb

Parameters

  • meaningId - surrogate id of specific meaning record in Ekilex database
  • datasets - optional. Comma delimited list of supported dataset codes. Only lexemes of specified datasets are retrieved or all if not specified

Response

Example: meaningdetails_384064_result.json

search sources

Request

GET /api/source/search/{sourceProperty}

Example: /api/source/search/aap-6

Parameters

  • sourceProperty - value of source property to search. Meta symbols * and ? can be applied to make less specific search
    • * - placeholder for any number of any symbols in search word
    • ? - placeholder for any one symbol in search word

Response

Example: sourcesearch_aap-6_result.json

Data crud services overview*

*there are more - see endpoints spec

create word

Request

POST /api/word/create

Request params

  • crudRoleDataset

Request body

  • lexemeDataset - required
  • meaningId - optional, word and lexeme is created to existing meaning if specified
  • value
  • valuePrese
  • lang
  • displayMorphCode
  • genderCode
  • aspectCode
  • vocalForm

The response includes the created word id.

NB! For all practical purposes crudRoleDataset and lexemeDataset have the same value (e.g 'kce' for minor testing, provided that you have the CRUD rights to that dataset). Use meaningId only for adding abbreviations, ortographic variants etc within your own dataset. Similarly, best practices and/or list of possible values apply to all other fields.

create word type

Request

POST /api/word_type/create

Request params

  • crudRoleDataset

Request body

  • wordId
  • classifierCode

create word relation

Request

POST /api/word_relation/create

Request params

  • crudRoleDataset

Request body

  • wordId
  • targetWordId
  • relationTypeCode
  • oppositeRelationTypeCode - optional, opposite relation is created if specified

create word note

Request

POST /api/word_note/create

Request body

  • wordId
  • valuePrese

create od word recommendation (ÕS soovitab)

Request

POST /api/od_word_recommendation/create

Request params

  • crudRoleDataset

Request body

  • wordId
  • valuePrese

update word

Request

POST /api/word/update

Request params

  • crudRoleDataset

Request body

  • wordId
  • value
  • valuePrese
  • lang
  • displayMorphCode
  • genderCode
  • aspectCode
  • vocalForm

You are advised to fill all the values using /api/word/details/{wordId} first, then do the necessary changes and use /api/word/update/ to post your updated set.

update word note

Request

POST /api/word_note/update

Request params

  • crudRoleDataset

Request body

  • freeformId
  • valuePrese

update od word recommendation (ÕS soovitab)

Request

POST /api/od_word_recommendation/update

Request params

  • crudRoleDataset

Request body

  • freeformId
  • valuePrese

delete lexeme (word and meaning are automatically deleted)

Request

POST /api/lexeme/delete

Request params

  • crudRoleDataset
  • lexemeId

delete word type

Request

POST /api/word_type/delete

Request params

  • crudRoleDataset

Request body

  • wordId
  • classifierCode

delete word relation

Request

POST /api/word_relation/delete

Request params

  • crudRoleDataset
  • relationId

NB! Unlike /api/word_relation/create, deleting has to be done twice. Relations are bidirectional, remember to delete the other end.

delete word note

Request

POST /api/word_note/delete

Request params

  • crudRoleDataset
  • wordNoteId

delete od word recommendation (ÕS soovitab)

Request

POST /api/od_word_recommendation/delete

Request params

  • crudRoleDataset
  • odWordRecommendationId