{"info":{"_postman_id":"1bb446db-197f-40ad-97a7-064a10372a90","name":"Got It AI - Translation","description":"<html><head></head><body><p>We've made our RESTful API to be really easy to you implement. Our goal is that with <strong>a simple HTTP request, you can translate your text!</strong></p>\n<p>Right below there is a brief overview of how to implement our API, and after, a more in-depth description of each implementation detail.</p>\n<p>You will see that our API is very easy to implement!</p>\n<hr>\n<h1 id=\"implementation\">Implementation</h1>\n<p>See how it's easy and fast to implement:</p>\n<ol>\n<li>Authenticate your request using your <code>API Key</code> <em>Below are all the details about the<code> API Key</code></em>.</li>\n<li>Create a <code>JSON</code> object with the translation data you want to perform. That is: your text, and the languages of the source text and the desired translation.</li>\n<li>Execute a <code>POST</code> request, passing this data.</li>\n</ol>\n<p><strong>Done! In the response of this request will be the translation result.</strong></p>\n<hr>\n<h1 id=\"endpoint\">EndPoint</h1>\n<p>To keep it extremally simple, we use only 1 endpoint! Simply make a <code>HTTP</code> request using the<code> POST</code> method for the endpoint (URL):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://api.gotit.ai/Translation/v1.1/Translate\n</code></pre><br>\n\n<h3 id=\"versioning\">Versioning:</h3>\n<p>To achive maximum development while ensuring stability, we use the <em>versioning</em> system directly in the EndPoint's URL. Note that in the example above, the most recent current version is specified: <code>v1.1</code>.</p>\n<p>If no version is specified, the execution will be performed using the oldest <strong>not obsolete</strong> version (currently <code>v1.1</code>). Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://api.gotit.ai/Translation/Translate\n</code></pre><p><br>If only the major version is specified, without the minor version, execution will be performed using the specified major version and the minor oldest <strong>non-obsolete</strong> version (for <code>v1</code>: currently<code> v1.1</code>). Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://api.gotit.ai/Translation/v1/Translate\n</code></pre><p><br> <strong>Please note:</strong> Currently the most recent version is <code>v1.1</code>. We recommend that you always specify the exact version to ensure maximum stability. Also stay tuned in our blog, emails and the Got It AI newsletter. Through them, we will keep you informed of the advances in our technology and new versions available!</p>\n<br>\n\n<h5 id=\"important\">Important:</h5>\n<ul>\n<li><p>Requests using the <code>GET</code> method will not be accepted, or any other method than<code> POST</code>. Requests for this endpoint that do not use the <code>POST</code> method will receive the HTTP status code<code> 401 Unauthorized</code> in response, indicating an unauthorized access error.</p>\n</li>\n<li><p>All requests must be executed using the <code>HTTPS</code> protocol. Requests that are made with the <code>HTTP</code> protocol only, without using a secure connection, will receive the HTTP 401 Unauthorized` status code, indicating an unauthorized access error.</p>\n</li>\n</ul>\n<hr>\n<h1 id=\"authentication\">Authentication</h1>\n<p>Every request needs to be authenticated. To do so, you will pass your <code>API Key</code> on each request you make. Below we explain what a <code>API Key</code> is, how you get yours, and how you put it in your request.</p>\n<p>If you are an expert, I will give a more straightforward explanation: you will use the <code>Basic Authentication</code> scheme of the HTTP protocol, passing your <code> API Key</code>, in the <code>Authorization</code> header of the request.</p>\n<br>\n\n<h3 id=\"api-key\">API Key</h3>\n<p>The <code>API Key</code> is your access credential, like a password, used only to perform the translation on our API.</p>\n<p>Your <code>API Key</code> is different from your Got It AI password. Your password is only for managing your Got It AI account. Your <code>API Key</code> is another separate credential, which is the only credential you will pass to our API on your request.</p>\n<p>Each <code>API Key</code> is composed of a pair of strings, as if it were an \"username and password\" pair. The <code>API Key</code> is composed of the pair:</p>\n<ul>\n<li>Identifier<ul>\n<li><em>This is the identifier of your <code>API Key</code>, as if it were an username/login</em></li>\n</ul>\n</li>\n<li>Secret<ul>\n<li><em>This is the secret of your <code>API Key</code>, as if it were a password</em></li>\n</ul>\n</li>\n</ul>\n<p><code>API Key</code> example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Identifier: 86-jIqiXoug\nSecret:     soOW1VchGaSMYIKwE4tr5q5KmjGb4uCvft2CFuSg\n</code></pre><p><em>This example <code>API Key</code> will be used several times during this documentation. Your <code>API Key</code> will be similar to it. You can use all the examples in this documentation by just replacing the <code>API Key</code> example with your <code>API Key</code>.</em></p>\n<br>\n\n<h5 id=\"where-can-i-get-my-api-key\">Where can I get my <code>API Key</code></h5>\n<p>When you register on the Got It AI website, you will receive the a password to administer your account on our site. Also, it'll be asked to you validade your email address. Once you did that, you can enter in the Got It AI website, Sign In with your password in the administrative area, and your <code>API Key</code> will be available there.</p>\n<p>You may also create new <code>API Key</code>s, or even revoke any compromised <code>API Key</code> in the administrative area of our site.</p>\n<ul>\n<li>This area will be available soon. Wait.*</li>\n</ul>\n<p>While the administrative area is not available, feel free to contact our support staff to request new <code>API Key</code>s, or revoke a compromised one.</p>\n<br>\n\n<h5 id=\"isolation\">Isolation</h5>\n<p>We chose to use authentication with <code>API Key</code>s, because it allows two very important things:</p>\n<ul>\n<li>Your Got It AI account and your <code>API Key</code> are different credentials.<ul>\n<li><em>Your Got It AI account, which has your information, is protected, completely separate from the credentials you use in your applications to access our API. That is: In your application that uses our API, only your <code>API Key</code> will be used. If for any reason someone accesses this credential, your information on your Got It AI account will be secure.</em></li>\n</ul>\n</li>\n<li>You can have more than one <code>API Key</code>!<ul>\n<li><em>In fact, not only can you, but you should use an <code>API Key</code> for each application that accesses our API. Thus, if an one of your applications is compromised, only that <code>API Key</code> will be compromised, and only that one will be revoked. That way, all your other <code>API Key</code>s and the applications that use them will be safe, and won't suffer downtime.</em></li>\n</ul>\n</li>\n</ul>\n<br>\n\n<h3 id=\"authenticating-your-request\">Authenticating your request</h3>\n<p>To authenticate your request, use the <code>Authorization</code> header in your<code> HTTP</code> request. This header can be used with many different schemas, but for our API we gonna use the most simple and easy of them, the <code>Basic Authentication</code> one.</p>\n<p>Using <code>Basic Authentication</code> on the header <code>Authorization</code> is very easy.\nYou will set the value of your <code>Authorization</code> header to <code>Basic &lt;your API converted to Base64&gt;</code>.</p>\n<p>That is, you will literally write <code>Basic</code>, including the space at the end, plus your API Key (Identifier and Secret, concatenated with a <code>:</code> between them), converted to Base64.</p>\n<h5 id=\"example\">Example:</h5>\n<p><code>API Key</code>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Identifier: 86-jIqiXoug\nSecret:     soOW1VchGaSMYIKwE4tr5q5KmjGb4uCvft2CFuSg\n</code></pre><h6 id=\"step-by-step\">Step by step:</h6>\n<ol>\n<li><p>You will concatenate the username and password (in this case Identifier and Secret respectively) using a <code>:</code> (colon) between the two. It'll be like this:</p>\n<p>   <code>86-jIqiXoug:soOW1VchGaSMYIKwE4tr5q5KmjGb4uCvft2CFuSg</code></p>\n</li>\n<li><p>Now just convert this string to base64. It'll be like this:</p>\n<p>  <code>ODYtaklxaVhvdWc6c29PVzFWY2hHYVNNWUlLd0U0dHI1cTVLbWpHYjR1Q3ZmdDJDRnVTZw==</code></p>\n</li>\n<li><p>Now just concatenate the <code>Basic </code> string (including the space) with the converted <code>API Key</code>. It'll be like this:</p>\n<p>  <code>Basic ODYtaklxaVhvdWc6c29PVzFWY2hHYVNNWUlLd0U0dHI1cTVLbWpHYjR1Q3ZmdDJDRnVTZw==</code></p>\n</li>\n<li><p>Set the <code>Authorization</code> header to the value of step 3 in your request. This header in your <code>HTTP POST</code> request looks like this:</p>\n<p> <code>Authorization: Basic ODYtaklxaVhvdWc6c29PVzFWY2hHYVNNWUlLd0U0dHI1cTVLbWpHYjR1Q3ZmdDJDRnVTZw==</code></p>\n</li>\n</ol>\n<p><strong>Done! Your request is authenticated!</strong></p>\n<br>\n\n<h5 id=\"notes\">Notes</h5>\n<ul>\n<li><p>The standard <code>Basic Authentication</code> scheme works with username and password, concatenated using a<code>: </code>(colon) between them. In our implementation, the equivalent username is the <code>API Key Identifier</code> and the equivalent password is the<code> API Key Secret</code>.</p>\n</li>\n<li><p>If you do not know the <code>Basic Authentication</code> scheme of the<code> Authorization</code> header just google these terms. There are excellent explanations that i'm sure will answer any questions you have.</p>\n</li>\n<li><p>If you don't know how or have questions about how to implement the <code>HTTP POST</code> request setting the <code>Authorization</code> header, we have provided excellent code examples on our webpage. Of course, you also can always search Google on how to create a POST request, and how to set the <code>Authorization</code> header specifically for your programming language. These are very simple terms, with a lot of good stuff about them.</p>\n</li>\n</ul>\n<hr>\n<h1 id=\"sla\">SLA</h1>\n<p>Our service levels will meet the following minimum requirements:</p>\n<p>99.9% uptime online availability.</p>\n<hr>\n<h1 id=\"code-examples\">Code Examples</h1>\n<p>Below there are several code blocks in different languages to help you get started right now! Just copy and paste the code of your desired language, and edit it inserting your own API Key (by replacing <code>#APIKey_Identifier#</code> with your API Key Identifier and <code>#APIKey_Secret#</code> with your API Key Secret), and done!</p>\n<br>\n\n\n<h3 id=\"python\">Python</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>import json\nimport requests\nimport pprint\nimport base64\n\nurl = 'https://api.gotit.ai/Translation/v1.1/Translate'\ndata = {\"T\":\"Victor ate a delicious pizza.\",\"SL\":\"EnUs\",\"TL\":\"PtBr\"}\ndata_json = json.dumps(data)\nuserAndPass = base64.b64encode(b\"#APIKey_Identifier#:#APIKey_Secret#\").decode(\"ascii\")\nheaders = {'Content-type': 'application/json', \"Authorization\": \"Basic %s\" %  userAndPass}\nresponse = requests.post(url, data=data_json, headers=headers)\npprint.pprint(response.json())\n</code></pre><br>\n\n\n<h3 id=\"c\">C#</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>static async Task MainAsync()\n{\n    // ... Use HttpClient.\n    HttpClient client = new HttpClient();\n\n    var byteArray = Encoding.ASCII.GetBytes(\"#APIKey_Identifier#:#APIKey_Secret#\");\n    client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(\"Basic\", Convert.ToBase64String(byteArray));\n\n    var data = new { T = \"Victor ate a delicious pizza.\", SL = \"EnUs\", TL = \"PtBr\" };\n    var content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, \"application/json\");\n\n    HttpResponseMessage response = await client.PostAsync(\"https://api.gotit.ai/Translation/v1.1/Translate\", content);\n    HttpContent responseContent = response.Content;\n\n    // ... Check Status Code                                \n    Console.WriteLine(\"Response StatusCode: \" + (int)response.StatusCode);\n\n    // ... Read the string.\n    string result = await responseContent.ReadAsStringAsync();\n}\n</code></pre><br>\n\n\n<h3 id=\"java\">Java</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>public static void main(String[] args) throws ClientProtocolException, IOException, JSONException  {\n    String url = \"https://api.gotit.ai/Translation/v1.1/Translate\";\n\n    HttpClient client = HttpClientBuilder.create().build();\n    HttpPost post = new HttpPost(url);\n\n    String authString = \"#APIKey_Identifier#\" + \":\" + \"#APIKey_Secret#\";\n    String authStringEnc = new String(Base64.getEncoder().encodeToString(authString.getBytes()));\n\n    post.addHeader(\"Content-Type\",\"application/json\");\n    post.addHeader(\"Authorization\",\"Basic \" + authStringEnc);\n\n    JSONObject data = new JSONObject();\n    data.put(\"T\", \"Victor ate a delicious pizza.\");    \n    data.put(\"SL\", \"EnUs\"); \n    data.put(\"TL\", \"PtBr\"); \n\n    post.setEntity(new StringEntity(data.toString(), ContentType.APPLICATION_JSON));\n\n    HttpResponse response = client.execute(post);\n\n    BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\n    StringBuffer result = new StringBuffer();\n    String line = \"\";\n    while ((line = rd.readLine()) != null) {\n        result.append(line);\n    }\n\n    System.out.println(result.toString());\n}\n</code></pre><br>\n\n\n<h3 id=\"php\">PHP</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>$headers =  array(\n    \"Content-type: application/json\",\n    \"Authorization: Basic \". base64_encode(\"#APIKey_Identifier#:#APIKey_Secret#\")\n);\n\n$data_array = array();\n$data_array [\"T\"] = \"Victor ate a delicious pizza.\";\n$data_array [\"SL\"] = \"EnUs\";\n$data_array [\"TL\"] = \"PtBr\";\n$data = json_encode($data_array );\n\n$options = array (\n    'http' =&gt; array (\n        'header' =&gt; $headers,\n        'method' =&gt; 'POST',\n        'content' =&gt; $data\n    )\n);\n$context  = stream_context_create ($options);\n$result = file_get_contents ('https://api.gotit.ai/Translation/v1.1/Translate', false, $context);\n\n$result = json_decode($result, true);\n</code></pre><br>\n\n\n<h3 id=\"ruby\">Ruby</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>require 'net/http'\nrequire 'uri'\n\nuri = URI.parse(\"https://api.gotit.ai/Translation/v1.1/Translate\")\nrequest = Net::HTTP::Post.new(uri, 'Content-Type' =&gt; 'application/json')\nrequest.basic_auth(\"#APIKey_Identifier#\", \"#APIKey_Secret#\")\nrequest.body = {T: 'Victor ate a delicious pizza.', SL: 'EnUs', TL: 'PtBr'}.to_json\n\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == \"https\") do |http|\nhttp.request(request)\n\nend\n</code></pre></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Implementation","slug":"implementation"},{"content":"EndPoint","slug":"endpoint"},{"content":"Authentication","slug":"authentication"},{"content":"SLA","slug":"sla"},{"content":"Code Examples","slug":"code-examples"}],"owner":"4456678","collectionId":"1bb446db-197f-40ad-97a7-064a10372a90","publishedId":"SVSRJS79","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-07-25T11:20:50.000Z"},"item":[{"name":"Translation","id":"21d90dcc-0a5b-4fc8-b54c-fd0df213e0a3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Basic ODYtaklxaVhvdWc6c29PVzFWY2hHYVNNWUlLd0U0dHI1cTVLbWpHYjR1Q3ZmdDJDRnVTZw=="}],"body":{"mode":"raw","raw":"{\n    \"T\": \"Victor ate a delicious pizza.\",\n    \"SL\": \"EnUs\",\n    \"TL\": \"PtBr\"\n}"},"url":"https://api.gotit.ai/Translation/v1.1/Translate","description":"<p>To perform the text translation, simply execute the <code>HTTPS</code> request, using the <code>POST</code> method, sending in the body of the request the <code>JSON</code> example object, passing 3 parameters:</p>\n<p><code>T</code> - <em>Source text encoded in UTF-8</em>\n<br />\n<code>SL</code> - <em>Source text's language code</em>\n<br />\n<code>TL</code> - <em>Desired language code for translation</em>\n<br /></p>\n<p>The currently supported language codes for both the Source Text and the Desired Translation are:</p>\n<p><code>EnUs</code> - <em>English (United States / International)</em>\n<br />\n<code>EsEs</code> - <em>Spanish</em>\n<br />\n<code>PtBr</code> - <em>Brazilian Portuguese</em>\n<br />\n<code>ZhCh</code> - <em>Chinese (Simplified)</em>\n<br />\n<code>DeAl</code> - <em>German</em>\n<br />\n<code>FrFr</code> - <em>French</em>\n<br />\n<code>RuRu</code> - <em>Russian</em>\n<br />\n<code>ArAr</code> - <em>Arabic</em>\n<br /></p>\n<p>Below is a complete example of the request:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /Translation/v1.1/Translate HTTP/1.1\nHost: api.gotit.ai\nContent-Type: application/json\nAuthorization: Basic ODYtaklxaVhvdWc6c29PVzFWY2hHYVNNWUlLd0U0dHI1cTVLbWpHYjR1Q3ZmdDJDRnVTZw==\n\n{\n    \"T\": \"Victor ate a delicious pizza.\",\n    \"SL\": \"EnUs\",\n    \"TL\": \"PtBr\"\n}\n</code></pre><br />\nBelow you have an example of *Headers* and `JSON` that should be sent in *Body*:","urlObject":{"protocol":"https","path":["Translation","v1.1","Translate"],"host":["api","gotit","ai"],"query":[],"variable":[]}},"response":[{"id":"a6218f87-72eb-40f8-a69e-7b8ad3633bc9","name":"Translation","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Basic ODYtaklxaVhvdWc6c29PVzFWY2hHYVNNWUlLd0U0dHI1cTVLbWpHYjR1Q3ZmdDJDRnVTZw=="}],"body":{"mode":"raw","raw":"{\n    \"T\": \"Victor ate a delicious pizza.\",\n    \"SL\": \"EnUs\",\n    \"TL\": \"PtBr\"\n}"},"url":"https://api.gotit.ai/Translation/v1.1/Translate"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Transfer-Encoding","value":"chunked"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Mon, 17 Jun 2019 19:37:48 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"result\": \"Victor comeu uma pizza deliciosa\"\n}"}],"_postman_id":"21d90dcc-0a5b-4fc8-b54c-fd0df213e0a3"}],"auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]}},"event":[{"listen":"prerequest","script":{"id":"ab4d985a-a569-49ed-902d-eb2dbcd3b8b5","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"aecc35fd-0fc7-42eb-89b7-4166c2202fca","type":"text/javascript","exec":[""]}}]}