# Internal Search API Investigation We have received some sample data from Naviplus, structured as such: | itemid | url | title | desc | narrow13 | narrow1 | narrow12 | |--------|------|--------|-------|----------|---------|----------| | http://www.fancl.co.jp/beauty/micle/index.html | http://www.fancl.co.jp/beauty/micle/index.html | おみごと三段落ち マイルドクレンジングオイル ≪ファンケル≫マイルドクレンジングオイル スペシャルサイト | おみごと三段落ち マイルドクレンジングオイル の1本に。 | beauty | 2 | 0 | After looking at the sample, we have some interrogations about how Naviplus intend to use the internal site search API with their data. The proposed API has the notion of "translation sets" that are referenced by id, which contain multiple "terms" (words or sentences to translate) as well as a "callback url" that is called when the terms translations are available. The current intended use of the API is the following : - Naviplus registers terms for a translation set with a PUT /register_terms query. - Wovn asynchronously translates the terms and invoke the callback url when it's done - Naviplus can access the translated terms with a GET /terms query. Naviplus can also access the Wovn dashboard to view and edit the translations. We are not sure how the Naviplus data we received will fit this usage, could you clarify what the columns correspond to ? - itemid : the translation set id ? - url : the callback url ? - title : the item to translate ? - desc, narrow13, narrow1, narrow12 : unused ? We'd like to hear Naviplus feedback about the current API design, how they intend to use it and if it's missing features (for example, need for multiple translation sets, delete terms, etc). ## Sample API requests For reference, here is a sample CURL command that demonstrate the use of the API (note that there is no authentication API in place yet, but the endpoint has been authorized for Naviplus ips 124.33.203.210 and 54.178.190.188, feel free to try it). ### PUT /register_terms ``` # Register a new term "行こう" in the "new_set" translation set # Wovn will invoke the callback url "https://httpbin.org/post" when it's done translating curl --request PUT \ --url https://api.staging5-wovn.com/v0/register_terms \ --header 'content-type: application/json' \ --data '{ "project_token": "iJljnV", "callback_url": "https://httpbin.org/post", "translation_sets": [ { "id": "new_set", "terms": [ { "id": 6, "src": "行こう" } ] } ] }' ``` ### GET /terms ``` # Query the translated terms in the "new_set" translation set: curl --request GET \ --url https://api.staging5-wovn.com/v0/terms \ --form project_token=iJljnV \ --form 'translation_set_ids[]=new_set' The response contains the translations for the "new_set" translation set's terms { "translation_sets": [ { "id": "new_set", "terms": [ { "id": "6", "src": "行こう", "translations": { "en": "let's go", "fr": "On y va" } } ] } ] } ```