{ "swagger": "2.0", "info": { "version": "1.0.15", "title": "Dédalo Publication Server REST API 1.0.15", "description": "Builds Public Dédalo data for publication. Use this online tool to test your data, and remember to always enter your authentication code when running a test call.
This API is focused on Oral History files and is for general purpose. If you need special functions or custom results, you can join the API development team by contacting the source developers (also known as Alex & Paco) at webmaster@render.es ", "license": { "name": "Apache 2.0 license", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "contact": { "name": "Aditional Dédalo publication info", "url": "http://master.render.es/dedalo/lib/dedalo/publication/server_api/v1/docu/API_docu_v1.pdf" } }, "host": "monedaiberica.org", "schemes": [ "https", "http" ], "basePath": "/dedalo/lib/dedalo/publication/server_api/v1/json/", "produces": [ "application/json" ], "tags": [ { "name": "Info", "description": "Informative calls" }, { "name": "Records", "description": "Generic data get functions" }, { "name": "Thesaurus", "description": "Specific hierarchy and thesaurus functions" }, { "name": "Free", "description": "Search functions in transcription text" }, { "name": "Video view", "description": "Utils for get video player general data" }, { "name": "Global", "description": "Search in all data functions" }, { "name": "Utils", "description": "Special utils" } ], "definitions": { "table_list": { "type": "object", "required": [ "table_name" ], "properties": { "table_name": { "type": "array", "items": { "$ref": "#/definitions/field_item" } } } }, "field_item": { "type": "string", "example": "section_id" }, "result": { "type": "array", "items": { "$ref": "#/definitions/row" } }, "row": { "type": "object", "required": [ "table" ], "properties": { "table": { "type": "string", "example": "interview" } } }, "msg": { "type": "string", "example": "Request done" }, "item_response": { "type": "object", "properties": { "msg": { "$ref": "#/definitions/msg" }, "result": { "type": "array", "items": { "$ref": "#/definitions/item_object" } } } }, "item_object": { "type": "object" }, "response": { "type": "object", "properties": { "result": { "type": "array", "items": { "$ref": "#/definitions/item_response" } } } } }, "parameters": { "code": { "name": "code", "in": "query", "required": true, "description": "Auth code (mandatory)", "type": "string", "default": "654asdiKrhdTetQksluoQaW2" }, "db_name": { "name": "db_name", "in": "query", "required": false, "description": "Database name. If not defined, the default database will be used", "type": "string", "default": "web_numisdata_mib_v2" }, "lang": { "name": "lang", "in": "query", "required": false, "description": "Query lang filter. Use Dédalo lang format like lg-eng for english. If undefined, API server settings default lang is used", "type": "string", "default": "lg-eng" }, "ar_fields": { "name": "ar_fields", "in": "query", "required": false, "description": "Comma separated list of required columns in table", "type": "string" }, "rows_per_page": { "name": "rows_per_page", "in": "query", "required": false, "description": "Number of records in each page", "type": "integer", "format": "int" } }, "paths": { "/tables_info": { "get": { "summary": "Info about tables schema", "description": "Get complete info about current available tables and columns.", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" } ], "tags": [ "Info" ], "responses": { "200": { "description": "Successful response", "schema": { "$ref": "#/definitions/table_list" } } } } }, "/publication_schema": { "get": { "summary": "Info about automatic portal resolution map", "description": "Get complete info about current publication_schema.", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" } ], "tags": [ "Info" ], "responses": { "200": { "description": "Successful response", "schema": { "$ref": "#/definitions/table_list" } } } } }, "/records": { "post": { "description": "Search records with current params in requested table.", "summary": "Get records from DDBB", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "name": "table", "in": "query", "type": "string", "format": "string", "default": "interview" }, { "$ref": "#/parameters/ar_fields" }, { "name": "section_id", "in": "query", "description": "Filter by specific section_id. Like 1. Also, it is valid a sequence separated by comma, like 1,4,5", "required": false, "type": "string", "format": "string" }, { "name": "sql_fullselect", "in": "query", "description": "Custom sql select for builds query. Replaces any other columns or table selection option. i.e. 'SELECT mycolumn FROM mytable'", "required": false, "type": "string" }, { "name": "sql_filter", "in": "query", "description": "Custom query added to standard filter", "required": false, "type": "string", "format": "string" }, { "$ref": "#/parameters/lang" }, { "name": "order", "in": "query", "description": "Custom order for result.Set null for no sort", "required": false, "type": "string", "format": "string" }, { "name": "limit", "in": "query", "description": "Maximum records returned in query. 0 for no limit", "required": false, "type": "number", "format": "int", "default": 10 }, { "name": "group", "in": "query", "description": "Custom group query for sql like 'lang'", "required": false, "type": "string", "format": "string" }, { "name": "offset", "in": "query", "description": "Custom records offset for query", "required": false, "type": "number", "format": "int" }, { "name": "count", "in": "query", "description": "Activates total records counter for pagination", "required": false, "type": "boolean", "format": "bool" }, { "name": "resolve_portal", "in": "query", "description": "Activates automatic resolution of portals option. Default is false", "required": false, "type": "boolean", "format": "bool" }, { "name": "resolve_portals_custom", "in": "query", "description": "Resolve requested portals only. Use a json map object like '{\"audiovisual\":\"audiovisual\",\"informant\":\"informant\"}' where key is column name and value is target table. To resolve deeper, use format '{\"table.column\":\"table\"}'", "required": false, "type": "string", "format": "string" }, { "name": "map", "in": "query", "description": "json representation of array of objects like [{\"table\": \"informant\",\"field\":birthplace_id\",\"function\":\"resolve_geolocation\",\"output_field\":\"birthplace_obj\"}]", "required": false, "type": "string", "format": "string" } ], "tags": [ "Records" ], "responses": { "200": { "description": "Successful response", "schema": { "$ref": "#/definitions/result" } }, "500": { "description": "Server error" } } } }, "/reel_terms": { "post": { "summary": "Get reel indexed terms", "description": "Resolve all terms used in the indexation of the given reel transcription (audiovisual record).", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "av_section_id", "in": "query", "description": "audiovisual section id (one or various separated by comma)", "type": "string", "required": true } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "Successful response", "schema": { "$ref": "#/definitions/result" } } } } }, "/fragment_from_index_locator": { "post": { "summary": "Build fragment of text and video from a index locator", "description": "Calculate all fragments indexed with this locator.", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "index_locator", "in": "query", "description": "locator object encoded as json like {\"section_tipo\":\"rsc167\",\"section_id\":\"1\",\"tag_id\":\"1\"}", "required": true, "type": "string", "default": "{\"section_tipo\":\"rsc167\",\"section_id\":\"1\",\"tag_id\":\"1\"}" } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "Successful response", "schema": { "$ref": "#/definitions/result" } } } } }, "/thesaurus_root_list": { "post": { "summary": "Get first level of terms from thesaurus", "description": "Return an array of 'ts_term' objects with resolved data. You can use only the data or (in PHP) manage 'ts_term' objects to build custom html.", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "table", "in": "query", "description": "Optional comma separated names of thesaurus tables. If undefined, server config thesaurus tables are used", "required": false, "type": "string", "format": "string" }, { "name": "parents", "in": "query", "description": "Optional comma separated parents used as roots like 'hierarchy1_245,hierarchy1_253'. If defined, override default behaviour (from first elements of table like 'ts1_1)", "required": false, "type": "string", "format": "string" }, { "name": "exclude_tld", "in": "query", "description": "Optional comma separated list of tld to exclude like 'xx,rt'", "required": false, "type": "string", "format": "string" } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "Successful response", "schema": { "title": "Array of records", "type": "array", "items": { "title": "Records info", "type": "object", "properties": { "name": { "type": "string" }, "single": { "type": "boolean" } } } } } } } }, "/thesaurus_random_term": { "post": { "summary": "A random thesaurus term name", "description": "Return a random term from thesaurus tables", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "table", "in": "query", "description": "Optional comma separated names of thesaurus tables. If undefined, server config thesaurus tables are used", "required": false, "type": "string", "format": "string" }, { "name": "exclude_tld", "in": "query", "description": "Optional comma separated list of tld to exclude like 'xx,rt'", "required": false, "type": "string", "format": "string" } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "Successful response", "schema": { "title": "Array of records", "type": "array", "items": { "title": "Records info", "type": "object", "properties": { "name": { "type": "string" }, "single": { "type": "boolean" } } } } } } } }, "/thesaurus_search": { "post": { "summary": "Search into thesaurus term", "description": "Execute a search against thesaurus tables", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "table", "in": "query", "description": "Optional comma separated names of thesaurus tables. If undefined, server config thesaurus tables are used", "required": false, "type": "string", "format": "string" }, { "name": "exclude_tld", "in": "query", "description": "Optional comma separated list of tld to exclude like 'xx,rt'", "required": false, "type": "string", "format": "string" }, { "name": "q", "in": "query", "description": "string to search in database. Minimum 3 chars for full text search", "required": true, "type": "string", "default": "term" }, { "name": "rows_per_page", "in": "query", "description": "Pagination preference. One row per page is the default value", "required": false, "type": "integer", "format": "int" }, { "name": "page_number", "in": "query", "description": "Pagination preference. Current page number. One is default", "required": false, "type": "integer", "format": "int" }, { "name": "tree_root", "in": "query", "description": "Defines first element from build the hierarchy tree when showing the results. Accepted values first_parent | last_parent . Default is last_parent", "required": false, "type": "string", "format": "string" } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "Successful response", "schema": { "title": "Array of records", "type": "array", "items": { "title": "Records info", "type": "object", "properties": { "name": { "type": "string" }, "single": { "type": "boolean" } } } } } } } }, "/thesaurus_autocomplete": { "post": { "summary": "Predictive autocomplete search", "description": "Search string in database (begins with $q) and get array of max 25 records", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "table", "in": "query", "description": "Optional comma separated names of thesaurus tables. If undefined, server config thesaurus tables are used", "required": false, "type": "string", "format": "string" }, { "name": "q", "in": "query", "description": "string to search in database. Minimum 3 chars for full text search", "required": true, "type": "string", "default": "term" }, { "name": "format", "in": "query", "description": "Result format ('full' for object including term_id and 'simple' for term plain text). Default is 'simple'", "required": false, "type": "string", "default": "simple" }, { "name": "limit", "in": "query", "description": "Max number of records returned. Undefined uses default of 25", "type": "integer", "format": "int" } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "Successful response", "schema": { "title": "Array of records", "type": "array", "items": { "title": "Records info", "type": "object", "properties": { "name": { "type": "string" }, "single": { "type": "boolean" } } } } } } } }, "/thesaurus_term": { "post": { "summary": "Get thesaurus term objects (one or various)", "description": "Resolve one or more ts_term from ar_term_id", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "ar_term_id", "in": "query", "description": "Comma separated list of one or various term_id like 'ts1_1,ts1_2'", "required": true, "type": "string", "default": "ts1_1" }, { "name": "combine", "in": "query", "description": "Experimental (!). Optional combined result mode. Options: false | combined. Default is false. When is set to combine, only indexations with intersections are returned", "type": "string", "default": false } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "OK" } } } }, "/thesaurus_indexation_node": { "post": { "summary": "Indexation object with all required info", "description": "Builds a indexation_node data object", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "term_id", "in": "query", "description": "Term id like 'ts1_1'", "type": "string", "required": true, "default": "ts1_1" }, { "name": "ar_locators", "in": "query", "description": "json encoded array of locators like [{locator1},{locator2}]", "type": "string", "required": true, "default": "[{\"type\":\"dd96\",\"tag_id\":\"1\",\"section_id\":\"1\",\"section_tipo\":\"rsc167\",\"component_tipo\":\"rsc36\",\"section_top_id\":\"1\",\"section_top_tipo\":\"oh1\",\"from_component_tipo\":\"hierarchy40\"},{\"type\":\"dd96\",\"tag_id\":\"1\",\"section_id\":\"4\",\"section_tipo\":\"rsc167\",\"component_tipo\":\"rsc36\",\"section_top_id\":\"3\",\"section_top_tipo\":\"oh1\",\"from_component_tipo\":\"hierarchy40\"}]" }, { "name": "image_type", "in": "query", "description": "Selects type of image to use. Values are 'identify_image', 'posterframe'. Default is posterframe", "type": "string", "required": false } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "OK" } } } }, "/thesaurus_video_view_data": { "post": { "summary": "Video player data", "description": "Deprecated (!). Gets data needed to build video fragment", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "term_id", "in": "query", "description": "Term id to get data like ts1_1", "required": true, "type": "string", "default": "ts1_1" }, { "name": "ar_locators", "in": "query", "description": "JSON encoded array of locator objects like [{\"type\":\"dd96\",\"tag_id\":\"2\",\"section_id\":\"1\",\"section_tipo\":\"rsc167\",\"component_tipo\":\"rsc36\",\"section_top_id\":\"1\",\"section_top_tipo\":\"oh1\",\"from_component_tipo\":\"hierarchy40\"},{\"type\":\"dd96\",\"tag_id\":\"6\",\"section_id\":\"1\",\"section_tipo\":\"rsc167\",\"component_tipo\":\"rsc36\",\"section_top_id\":\"1\",\"section_top_tipo\":\"oh1\",\"from_component_tipo\":\"hierarchy40\"}]", "type": "string", "required": true, "default": "[{\"type\":\"dd96\",\"tag_id\":\"1\",\"section_id\":\"1\",\"section_tipo\":\"rsc167\",\"component_tipo\":\"rsc36\",\"section_top_id\":\"1\",\"section_top_tipo\":\"oh1\",\"from_component_tipo\":\"hierarchy40\"},{\"type\":\"dd96\",\"tag_id\":\"1\",\"section_id\":\"4\",\"section_tipo\":\"rsc167\",\"component_tipo\":\"rsc36\",\"section_top_id\":\"3\",\"section_top_tipo\":\"oh1\",\"from_component_tipo\":\"hierarchy40\"}]" }, { "name": "ar_locators_key", "in": "query", "description": "current array key selector. Default is '0'", "type": "integer", "required": false } ], "tags": [ "Thesaurus" ], "responses": { "200": { "description": "OK" } } } }, "/thesaurus_children": { "post": { "tags": [ "Thesaurus" ], "summary": "Search all children of current term", "description": "Exec a records query in current term table to find records with data parent equal to current term_id", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "$ref": "#/parameters/ar_fields" }, { "name": "term_id", "in": "query", "description": "Term id to get data like ts1_1", "type": "string", "required": true }, { "name": "recursive", "in": "query", "description": "set deep hierarchy search on true", "type": "boolean", "default": false }, { "name": "only_descriptors", "in": "query", "description": "Exclude no descriptors in the result", "type": "boolean", "default": true }, { "name": "remove_restricted", "in": "query", "description": "Exclude restricted terms in the result", "type": "boolean", "default": true } ], "responses": { "200": { "description": "OK" } } } }, "/thesaurus_parents": { "post": { "tags": [ "Thesaurus" ], "summary": "Search all parents of current term", "description": "Exec a records query in current term table to find records with data children equal to current term_id", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "$ref": "#/parameters/ar_fields" }, { "name": "term_id", "in": "query", "description": "Term id to get data like ts1_2", "type": "string", "required": true }, { "name": "recursive", "in": "query", "description": "Set deep hierarchy search single or multi level", "type": "boolean", "default": false } ], "responses": { "200": { "description": "OK" } } } }, "/free_search": { "post": { "summary": "Find word/s in DDBB", "description": "Exec a search against transcription column in audiovisual table", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "q", "in": "query", "description": "String to search", "type": "string", "required": true, "default": "house" }, { "name": "search_mode", "in": "query", "description": "SQL type of search. Default is 'full_text_search'", "type": "string", "required": false }, { "name": "rows_per_page", "in": "query", "description": "Number of records returned by page. Default is 10", "type": "integer", "format": "int", "required": false }, { "name": "page_number", "in": "query", "description": "Current page number (pagination params)", "type": "integer", "format": "int", "required": false }, { "name": "offset", "in": "query", "description": "Offset used to paginate results. Default is 0", "type": "integer", "format": "int", "required": false }, { "name": "appearances_limit", "in": "query", "description": "Max number of appearances (matches) calculated. Default is 1", "type": "integer", "format": "int", "required": false }, { "name": "match_select", "in": "query", "description": "Selects specific match inside results. Default = false . Optional", "type": "boolean", "required": false }, { "name": "count", "in": "query", "description": "Exec total records count. Default is true", "type": "boolean", "required": false }, { "name": "image_type", "in": "query", "description": "Type of image returned. Options are posterframe | identify_image. Default is posterframe", "type": "string", "required": false }, { "name": "list_fragment", "in": "query", "description": "Resolve text fragment to show in list mode (small text, without video cut). Default is true", "type": "boolean", "required": false }, { "name": "video_fragment", "in": "query", "description": "Activates video fragment resolution (with extended transcription fragment and video cut). Default is false", "type": "boolean", "required": false }, { "name": "fragment_terms", "in": "query", "description": "Calculates terms (indexations) for current fragment of transcription. Default is false", "type": "boolean", "required": false }, { "name": "filter", "in": "query", "description": "Apply a filter to result like 'section_tipo = 1'", "type": "string", "required": false } ], "tags": [ "Free" ], "responses": { "200": { "description": "OK" } } } }, "/full_reel": { "post": { "summary": "Full transcriptions data", "description": "Get full reel data. Complete transcription without tc cut. Used when you need show full interview (mode full)", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "av_section_id", "in": "query", "description": "Section id number to filter records", "type": "integer", "format": "int", "required": true, "default": 1 }, { "name": "image_type", "in": "query", "description": "Type of image returned. Options are posterframe | identify_image. Default is posterframe", "type": "string", "required": false }, { "name": "terms", "in": "query", "description": "Resolves current transcription indexed terms. Default is false", "type": "boolean", "required": false } ], "tags": [ "Video view" ], "responses": { "200": { "description": "Successful response", "schema": { "type": "object", "properties": { "result": { "type": "object" }, "msg": { "type": "string" } } } } } } }, "/global_search": { "post": { "summary": "Find word/s in table global_search. Require a special server config!", "description": "Exec a search against full_data column in global_search table", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "$ref": "#/parameters/lang" }, { "name": "q", "in": "query", "description": "String to search (performs a full text search in column full_data)", "type": "string", "required": false, "default": "interview" }, { "name": "search_modifier", "in": "query", "description": "MySQL search_modifier \n(IN NATURAL LANGUAGE MODE | IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION | IN BOOLEAN MODE | WITH QUERY EXPANSION)", "type": "string", "required": false, "default": "IN BOOLEAN MODE" }, { "name": "sql_filter", "in": "query", "description": "Custom additional filter query (normally is added to standard filter 'q'). Example: filter_date >= 1936", "required": false, "type": "string", "format": "string" }, { "name": "count", "in": "query", "description": "Exec total records count. Default is true", "type": "boolean", "required": false, "default": true }, { "name": "rows_per_page", "in": "query", "description": "Number of records returned by page. Default is 10", "type": "integer", "format": "int", "required": false, "default": 10 }, { "name": "page_number", "in": "query", "description": "Current page number (pagination params)", "type": "integer", "format": "int", "required": false }, { "name": "offset", "in": "query", "description": "Offset used to paginate results. Default is 0", "type": "integer", "format": "int", "required": false, "default": 0 } ], "tags": [ "Global" ], "responses": { "200": { "description": "OK" } } } }, "/combi": { "post": { "summary": "Combined calls to api in one request", "description": "Exec an array of api requests in only one call to the server.", "parameters": [ { "$ref": "#/parameters/code" }, { "$ref": "#/parameters/db_name" }, { "name": "ar_calls", "in": "query", "description": "JSON stringified array of calls to api. Will be iterated and resolved in the server side. Example: [{\"id\":\"templates_all\",\"options\":{\"dedalo_get\":\"records\",\"table\":\"template_map\",\"ar_fields\":[\"data\",\"name\"],\"lang\":\"lg-spa\"}},{\"id\":\"menu_all\",\"options\":{\"dedalo_get\":\"records\",\"table\":\"ts_web\",\"ar_fields\":[\"section_id\",\"term_id\",\"term\",\"web_path\",\"parent\",\"children\",\"template_name\",\"title\",\"abstract\",\"body\",\"norder\",\"image\"],\"lang\":\"lg-spa\"}}] ", "required": true, "type": "string", "format": "string" } ], "tags": [ "Utils" ], "responses": { "200": { "description": "Successful response", "schema": { "$ref": "#/definitions/response" } } } } } } }