{"openapi":"3.1.0","info":{"title":"EU-FarmBook API - V2","description":"<h3> Welcome to the API documentation for the EU-FarmBook platform (v2) </h3> <br> The endpoints listed below provide contributors access to upload Knowledge Objects and metadata to the EU-FarmBook platform programatically. <br> Contributors are also able to download information from the EU-FarmBook for the projects for which they are registered. <br><h4> Prerequisites <br> </h4><ul> <li> You must have created an account with the  <a href='https://eufarmbook.eu'>EU-FarmBook</a>  </li> </ul> <ul> <li> You must be registered as a coordinator or contributor for a given project. <a href='https://eufarmbook.eu/contributors'>Click here</a> for more information. </li> </ul>","version":"2.0.0"},"paths":{"/api/authentication/token":{"post":{"tags":["Authentication"],"summary":"Get Token","description":"Use your EU-FarmBook username (email) and password to obtain an access token and a refresh token.","operationId":"get_token_api_authentication_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCredentials"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserTokens"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/authentication/projects":{"get":{"tags":["Authentication"],"summary":"Get Projects","description":"Fetch the projects which you have access to providing your access token and refresh token.","operationId":"get_projects_api_authentication_projects_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-User-UUID","in":"header","required":true,"schema":{"type":"string","title":"X-User-Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserProjects"},"title":"Response Get Projects Api Authentication Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upload/knowledge_object_file":{"post":{"tags":["Upload"],"summary":"Upload Knowledge Object File","operationId":"upload_knowledge_object_file_api_upload_knowledge_object_file_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"upload_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Source"}},{"name":"X-User-UUID","in":"header","required":true,"schema":{"type":"string","title":"X-User-Uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_knowledge_object_file_api_upload_knowledge_object_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upload/knowledge_object_metadata":{"post":{"tags":["Upload"],"summary":"Upload Knowledge Object Metadata","description":"Upload the metadata for a knowledge object to the EU-FarmBook database","operationId":"upload_knowledge_object_metadata_api_upload_knowledge_object_metadata_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"upload_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upload Source"}},{"name":"X-User-UUID","in":"header","required":true,"schema":{"type":"string","title":"X-User-Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeObjectMetadata"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/project/knowledge_object_metadata":{"post":{"tags":["Project"],"summary":"Get Knowledge Object Metadata","description":"Retrieve the metadata for all knowledge objects uploaded for your project","operationId":"get_knowledge_object_metadata_api_project_knowledge_object_metadata_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"X-User-UUID","in":"header","required":true,"schema":{"type":"string","title":"X-User-Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/query/metadata":{"post":{"tags":["Query"],"summary":"Query Ko Metadata With Filters","description":"Retrieve the metadata for all knowledge objects uploaded for your project","operationId":"query_ko_metadata_with_filters_api_query_metadata_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-User-UUID","in":"header","required":true,"schema":{"type":"string","title":"X-User-Uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"default":{},"title":"Criteria"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/metadata/topics":{"get":{"tags":["Metadata"],"summary":"Get Topics","operationId":"get_topics_api_metadata_topics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Topics Api Metadata Topics Get"}}}}}}},"/api/metadata/themes":{"get":{"tags":["Metadata"],"summary":"Get Themes","operationId":"get_themes_api_metadata_themes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Themes Api Metadata Themes Get"}}}}}}},"/api/metadata/categories":{"get":{"tags":["Metadata"],"summary":"Get Category","operationId":"get_category_api_metadata_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Category Api Metadata Categories Get"}}}}}}},"/api/metadata/subcategories":{"get":{"tags":["Metadata"],"summary":"Get Subcategories","operationId":"get_subcategories_api_metadata_subcategories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Subcategories Api Metadata Subcategories Get"}}}}}}},"/api/metadata/subcategories/details":{"get":{"tags":["Metadata"],"summary":"Get Subcategories Details","operationId":"get_subcategories_details_api_metadata_subcategories_details_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Subcategories Details Api Metadata Subcategories Details Get"}}}}}}},"/api/metadata/licenses":{"get":{"tags":["Metadata"],"summary":"Get License","operationId":"get_license_api_metadata_licenses_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get License Api Metadata Licenses Get"}}}}}}},"/api/metadata/locations":{"get":{"tags":["Metadata"],"summary":"Get Locations","operationId":"get_locations_api_metadata_locations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Locations Api Metadata Locations Get"}}}}}}},"/api/metadata/intended_purposes":{"get":{"tags":["Metadata"],"summary":"Get Intended Purposes","operationId":"get_intended_purposes_api_metadata_intended_purposes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Intended Purposes Api Metadata Intended Purposes Get"}}}}}}},"/api/metadata/languages":{"get":{"tags":["Metadata"],"summary":"Get Languages","operationId":"get_languages_api_metadata_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Languages Api Metadata Languages Get"}}}}}}},"/api/status/api_status":{"get":{"tags":["API Status"],"summary":"Get Api Status","description":"A simple check on the Public API status","operationId":"get_api_status_api_status_api_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/status/db_status":{"get":{"tags":["API Status"],"summary":"Get Db Status","description":"A simple check on the status of the EU-FarmBook database","operationId":"get_db_status_api_status_db_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Body_upload_knowledge_object_file_api_upload_knowledge_object_file_post":{"properties":{"ufile":{"type":"string","contentMediaType":"application/octet-stream","title":"Ufile"}},"type":"object","required":["ufile"],"title":"Body_upload_knowledge_object_file_api_upload_knowledge_object_file_post"},"Creator":{"properties":{"creator_type":{"$ref":"#/components/schemas/CreatorType"},"name":{"type":"string","title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"orcid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orcid"}},"type":"object","required":["creator_type","name","email"],"title":"Creator"},"CreatorType":{"type":"string","enum":["person","organization"],"title":"CreatorType"},"File":{"properties":{"ko_file_id":{"type":"string","title":"Ko File Id"},"language":{"type":"string","title":"Language"},"translations":{"items":{"type":"string"},"type":"array","title":"Translations"},"subtitles":{"items":{"type":"string"},"type":"array","title":"Subtitles"},"doi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doi"}},"type":"object","required":["ko_file_id","language"],"title":"File"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KnowledgeObjectMetadata":{"properties":{"files":{"anyOf":[{"items":{"$ref":"#/components/schemas/File"},"type":"array"},{"type":"null"}],"title":"Files"},"knowledge_object_url":{"anyOf":[{"$ref":"#/components/schemas/Knowledge_Object_Url"},{"type":"null"}]},"title":{"type":"string","title":"Title"},"subtitle":{"type":"string","title":"Subtitle"},"description":{"type":"string","title":"Description"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"creators":{"items":{"$ref":"#/components/schemas/Creator"},"type":"array","title":"Creators"},"collection":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection"},"date_of_completion":{"type":"string","title":"Date Of Completion"},"knowledge_object_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Object Version"},"intended_purposes":{"items":{"type":"string"},"type":"array","title":"Intended Purposes"},"locations":{"items":{"$ref":"#/components/schemas/Location"},"type":"array","title":"Locations"},"category":{"type":"string","title":"Category"},"subcategories":{"items":{"type":"string"},"type":"array","title":"Subcategories"},"topics":{"items":{"type":"string"},"type":"array","title":"Topics"},"themes":{"items":{"type":"string"},"type":"array","title":"Themes"},"license":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License"},"contributor_custom_metadata":{"additionalProperties":true,"type":"object","title":"Contributor Custom Metadata"},"ko_content_flat_summarised":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ko Content Flat Summarised"},"allow_ai_metadata_override":{"type":"boolean","title":"Allow Ai Metadata Override","default":true}},"type":"object","required":["title","subtitle","description","keywords","creators","date_of_completion","intended_purposes","locations","category","subcategories","topics","themes","license"],"title":"KnowledgeObjectMetadata"},"Knowledge_Object_Url":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"language":{"type":"string","title":"Language"},"translations":{"items":{"type":"string"},"type":"array","title":"Translations"},"subtitles":{"items":{"type":"string"},"type":"array","title":"Subtitles"},"doi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doi"}},"type":"object","required":["url","language"],"title":"Knowledge_Object_Url"},"Location":{"properties":{"nuts_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nuts Level","default":0},"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"Location"},"UserCredentials":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserCredentials"},"UserProjects":{"properties":{"project_id":{"type":"string","title":"Project Id"},"project_name":{"type":"string","title":"Project Name"}},"type":"object","required":["project_id","project_name"],"title":"UserProjects"},"UserTokens":{"properties":{"access_token":{"type":"string","title":"Access Token"},"uuid":{"type":"string","title":"Uuid"}},"type":"object","required":["access_token","uuid"],"title":"UserTokens"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}