{"openapi":"3.0.0","x-samples-languages":["curl","javascript","node","java","kotlin","python","php","go","swift"],"info":{"description":"The Karhoo Translations API Gateway service is responsible for providing access to translations, including creation/update and deletion of translations.","version":"v1.0","title":"Translations API 1.0","x-hugo-values":{"tags":["api"],"categories":["translations"],"public":true,"weight":60}},"paths":{"/":{"get":{"tags":["translations"],"summary":"Load translations","description":"Loads translations based on filtering parameters","parameters":[{"in":"query","name":"key","required":true,"description":"Valid key consits of two or more strings delimited by `|` where the first string identifies the group of translations:\n<ul>\n  <li> `karhoo-website|title` identifies translations of the title on the Karhoo website,</li>\n  <li> `karhoo-website|footer|copyright` identifies translations of the copyright information on the Karhoo website,</li>\n  <li> `fleet-meeting-points|cc785eea-9dba-4cd0-b02b-71ada94c073b|2298384f-fdfe-4252-a7b0-20cff67740fc` identifies translations of the meeting point intruction for some fleet and meeting point</li>\n</ul>\n\nValid key can also contains a wildcard character `*` as the last part:\n<ul>\n  <li> `karhoo-website|*` returns all translations for the Karhoo Website,</li>\n  <li> `fleet-meeting-points|cc785eea-9dba-4cd0-b02b-71ada94c073b|*` returns all meeting points' translations for some fleet</li>\n</ul>\n","schema":{"type":"string"}},{"in":"query","name":"locale","description":"Valid locale is a BCP 47 tag, e.g. en-U, fr-FR, de-DE. See https://tools.ietf.org/html/bcp47.\n\nIf no/empty locale is passed, translations in all locales are returned.","schema":{"type":"string"}}],"responses":{"200":{"description":"Map of translations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoadTranslationsResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"429":{"$ref":"#/components/responses/429RateLimit"},"500":{"$ref":"#/components/responses/500InternalServerErr"},"502":{"$ref":"#/components/responses/502BadGateway"}},"security":[{"Bearer":[]}]}},"/{key}":{"get":{"tags":["translations"],"summary":"Get translations by key","parameters":[{"in":"path","name":"key","required":true,"description":"Valid key consits of two or more strings delimited by `|` where the first string identifies the group of translations:\n<ul>\n  <li> `karhoo-website|title` identifies translations of the title on the Karhoo website,</li>\n  <li> `karhoo-website|footer|copyright` identifies translations of the copyright information on the Karhoo website,</li>\n  <li> `fleet-meeting-points|cc785eea-9dba-4cd0-b02b-71ada94c073b|2298384f-fdfe-4252-a7b0-20cff67740fc` identifies translations of the meeting point intruction for some fleet and meeting point</li>\n</ul>\n","schema":{"type":"string"}}],"responses":{"200":{"description":"List of translation objects","content":{"applications/json":{"schema":{"$ref":"#/components/schemas/Translations"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"429":{"$ref":"#/components/responses/429RateLimit"},"500":{"$ref":"#/components/responses/500InternalServerErr"},"502":{"$ref":"#/components/responses/502BadGateway"}},"security":[{"Bearer":[]}]},"put":{"tags":["translations"],"summary":"Adds or updates translations by key","parameters":[{"in":"path","name":"key","required":true,"description":"Valid key consits of two or more strings delimited by `|` where the first string identifies the group of translations:\n<ul>\n  <li> `karhoo-website|title` identifies translations of the title on the Karhoo website,</li>\n  <li> `karhoo-website|footer|copyright` identifies translations of the copyright information on the Karhoo website,</li>\n  <li> `fleet-meeting-points|cc785eea-9dba-4cd0-b02b-71ada94c073b|2298384f-fdfe-4252-a7b0-20cff67740fc` identifies translations of the meeting point intruction for some fleet and meeting point</li>\n</ul>\n","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Translations"}}},"description":"List of translation objects","required":true},"responses":{"200":{"description":"List of translation objects","content":{"applications/json":{"schema":{"$ref":"#/components/schemas/Translations"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"429":{"$ref":"#/components/responses/429RateLimit"},"500":{"$ref":"#/components/responses/500InternalServerErr"},"502":{"$ref":"#/components/responses/502BadGateway"}},"security":[{"Bearer":[]}]}},"/healthcheck":{"get":{"tags":["Healthcheck"],"summary":"Check Services","responses":{"204":{"description":"Success response, no content. Service is ok"}}}}},"servers":[{"url":"https://rest.sandbox.karhoo.com/v1/translations"}],"components":{"responses":{"400BadRequest":{"description":"Bad Request. The request was invalid.","content":{"*/*":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K0002","description":"Error number"},"message":{"type":"string","example":"Invalid request payload","description":"Details of the error"}}}}}},"401Unauthorized":{"description":"Unauthorized. The request requires user authentication (not logged in).","content":{"*/*":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K6001","description":"Error number"},"message":{"type":"string","example":"Could not authenticate","description":"Details of the error"}}}}}},"403Forbidden":{"description":"Forbidden. The credentials provided do not have sufficient authority for this request. Please request access by emailing [API Support](api@karhoo.com?subject=API%20Access%20Request).","content":{"*/*":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K0005","description":"Error number"},"message":{"type":"string","example":"Missing required role for this request","description":"Details of the error"}}}}}},"404NotFound":{"description":"Not found. Specific resource not found, or following information is not available anymore.","content":{"*/*":{"schema":{"type":"object","description":"Details of the error that occurred whilst processing the request","required":["code","message"],"properties":{"code":{"type":"string","description":"Internally generated code for this error","example":"K4003"},"message":{"type":"string","description":"Details of the error","example":"Could not book trip (could not find specified quote)"}}}}}},"429RateLimit":{"description":"Error. Too Many Requests. Exceeded the rate limit for requests.","content":{"*/*":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K0006","description":"Error number"},"message":{"type":"string","example":"Rate limit exceeded","description":"Details of the error"}}}}}},"500InternalServerErr":{"description":"Internal server error. Something has gone wrong on the website's server, but the server could not be more specific on what the exact problem is.","content":{"*/*":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K0001","description":"Error number"},"message":{"type":"string","example":"General request error","description":"Details of the error"}}}}}},"502BadGateway":{"description":"Bad Gateway. The server, which was acting as a gateway or proxy, received an invalid response from the upstream server.","content":{"*/*":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"K0000","description":"Error number"},"message":{"type":"string","example":"Bad Gateway error","description":"Details of the error"}}}}}}},"securitySchemes":{"Bearer":{"description":"For accessing the API a valid JWT token must be passed in all the queries in the 'Authorization' header. A valid JWT token is generated by the /v1/auth/token API. The following syntax must be used in the 'Authorization' header : `Bearer: xxxxxx.yyyyyyy.zzzzzz`","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"LoadTranslationsResponse":{"type":"object","description":"Map of translations","properties":{"translations":{"type":"object","description":"Multilevel map with keys as 1st level indicies, and locales as 2nd level indicies"}},"example":"{\n  \"translations\": {\n      \"meeting-points|some-fleet-id|some-poi\": {\n          \"en_GB\": \"translation in en_GB\",\n          \"fr_FR\": \"translation in fr_FR\"\n      },\n      \"meeting-points|some-fleet-id|other-poi\": {\n          \"en_GB\": \"other translation in en_GB\",\n          \"fr_FR\": \"other translation in fr_FR\"\n      },\n  }\n}"},"Translations":{"type":"object","description":"List of translation objects","properties":{"translations":{"type":"array","items":{"$ref":"#/components/schemas/Translation"}}},"example":"{\n  \"translations\": [\n      {\n          \"locale\": \"en_GB\":,\n          \"translation\": \"translation in en_GB\"\n      },\n      {\n          \"locale\": \"fr_FR\",\n          \"translation\": \"translation in fr_FR\"\n      }\n  ]\n}"},"Translation":{"type":"object","properties":{"locale":{"type":"string"},"translation":{"type":"string"}},"example":"{\n    \"locale\": \"en_GB\":,\n    \"translation\": \"translation in en_GB\"\n}"}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}