examples/api-samples/public/docs/sample26.html in groupdocs-1.5.7 vs examples/api-samples/public/docs/sample26.html in groupdocs-1.5.8
- old
+ new
@@ -47,14 +47,14 @@
<p>POST request</p>
</div>
<div class="content"><div class='highlight'><pre>post <span class="string">'/sample26'</span> <span class="keyword">do</span>
- set <span class="symbol">:email</span>, params[<span class="symbol">:email</span>]
+ set <span class="symbol">:email</span>, params[<span class="symbol">:login</span>]
set <span class="symbol">:password</span>, params[<span class="symbol">:password</span>]
+ set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
-
<span class="keyword">begin</span></pre></div></div>
</li>
@@ -62,44 +62,77 @@
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
- <p>check required variables</p>
+ <p>Check required variables</p>
</div>
- <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.email.empty? <span class="keyword">or</span> settings.password.empty?</pre></div></div>
+ <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.email.empty? <span class="keyword">or</span> settings.password.empty?
+
+ <span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
- <p>make a request to API using email and password</p>
+ <p>Configure your access to API server</p>
</div>
+ <div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|</pre></div></div>
+
+ </li>
+
+
+ <li id="section-5">
+ <div class="annotation">
+
+ <div class="pilwrap ">
+ <a class="pilcrow" href="#section-5">¶</a>
+ </div>
+ <p>Optionally specify API server and version</p>
+
+ </div>
+
+ <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
+ <span class="keyword">end</span></pre></div></div>
+
+ </li>
+
+
+ <li id="section-6">
+ <div class="annotation">
+
+ <div class="pilwrap ">
+ <a class="pilcrow" href="#section-6">¶</a>
+ </div>
+ <p>Make a request to API using email and password</p>
+
+ </div>
+
<div class="content"><div class='highlight'><pre> user = <span class="constant">GroupDocs::User</span>.login!(settings.email, settings.password)
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
err = e.message
<span class="keyword">end</span></pre></div></div>
</li>
- <li id="section-5">
+ <li id="section-7">
<div class="annotation">
<div class="pilwrap ">
- <a class="pilcrow" href="#section-5">¶</a>
+ <a class="pilcrow" href="#section-7">¶</a>
</div>
- <p>set variables for template</p>
+ <p>Set variables for template</p>
</div>
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample26</span>, <span class="symbol">:locals</span> => {<span class="symbol">:user</span> => user, <span class="symbol">:err</span> => err}
<span class="keyword">end</span></pre></div></div>