Files
doc-exports/docs/apig/umn/apig_0080101678.html
Chen, Junjie 324aa7d3c4 APIG UMN 20240708 version
Reviewed-by: Mützel, Andrea <andrea.muetzel@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2024-11-05 15:25:06 +00:00

137 lines
15 KiB
HTML

<a name="apig_0080101678"></a><a name="apig_0080101678"></a>
<h1 class="topictitle1">Creating an API</h1>
<div id="body8662426"><p id="apig_0080101678__en-us_topic_0000001174497011_p13417131318458">Procedure:</p>
<ol id="apig_0080101678__en-us_topic_0000001174497011_ol10841930204617"><li id="apig_0080101678__en-us_topic_0000001174497011_li1984130184616"><a href="#apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section8731554122615">Configuring Frontend Settings</a></li><li id="apig_0080101678__en-us_topic_0000001174497011_li384530134619"><a href="#apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section16484051169">Configuring Backend Settings</a></li></ol>
<div class="section" id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section8731554122615"><a name="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section8731554122615"></a><a name="en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section8731554122615"></a><h4 class="sectiontitle">Configuring Frontend Settings</h4><ol id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_ol43115541812"><li id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_li1311354012"><span>In the navigation pane, choose <strong id="apig_0080101678__b1091313775019">API Management</strong> &gt; <strong id="apig_0080101678__b391319705019">APIs</strong>.</span></li><li id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_li3311165411110"><span>Click <strong id="apig_0080101678__b1112943818515">Create API</strong> &gt; <strong id="apig_0080101678__b51301438653">Create API</strong> and configure the frontend.</span><p><div class="p" id="apig_0080101678__p14491011171917">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="apig_0080101678__table7915355151820" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Frontend definition</caption><thead align="left"><tr id="apig_0080101678__row169132557185"><th align="left" class="cellrowborder" valign="top" width="19.99%" id="mcps1.3.3.2.2.2.1.1.2.3.1.1"><p id="apig_0080101678__p8912755151813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80.01%" id="mcps1.3.3.2.2.2.1.1.2.3.1.2"><p id="apig_0080101678__p391320551183">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="apig_0080101678__row10913155511187"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p1891385531811">Name</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p1491312555189">API name. It is recommended that you enter a name based on naming rules to facilitate search.</p>
</td>
</tr>
<tr id="apig_0080101678__row10914145511188"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p1891417551185">Group</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p2914155531820">By default, the group created in <a href="apig-ug-180307003.html">Creating an API Group</a> is selected.</p>
</td>
</tr>
<tr id="apig_0080101678__row18914255131813"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p129141055111810">URL</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p0914155551813"><strong id="apig_0080101678__b15795128125112">Method</strong>: Request method of the API. Set this parameter to <strong id="apig_0080101678__b999811511503">POST</strong>.</p>
<p id="apig_0080101678__p39142055141813"><strong id="apig_0080101678__b159316197513">Protocol</strong>: Set this parameter to <strong id="apig_0080101678__b66899122514">HTTPS</strong>. </p>
<p id="apig_0080101678__p10914955191819">Subdomain name: The subdomain automatically allocated to the API group created in <a href="apig-ug-180307003.html">Creating an API Group</a>.</p>
<p id="apig_0080101678__p9914955171812"><strong id="apig_0080101678__b1219544275119">Path</strong>: Path for requesting the API.</p>
</td>
</tr>
<tr id="apig_0080101678__row891455516185"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p1391417557189">Gateway Response</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p79141855191816">Select a response to be displayed if API Gateway fails to process an API request.</p>
<p id="apig_0080101678__p9914855101813">The default gateway response is <strong id="apig_0080101678__b19259125915110">default</strong>.</p>
</td>
</tr>
<tr id="apig_0080101678__row17915155581811"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p189141755111812">Matching</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p2914555121816">By default, <strong id="apig_0080101678__b69135645220">Exact match</strong> is selected.</p>
</td>
</tr>
<tr id="apig_0080101678__row391585514182"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p491520559189">Tags</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p29151855131812">Classification attribute used to quickly identify the API from other APIs.</p>
</td>
</tr>
<tr id="apig_0080101678__row5915145561818"><td class="cellrowborder" valign="top" width="19.99%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p1915355171819">Description</p>
</td>
<td class="cellrowborder" valign="top" width="80.01%" headers="mcps1.3.3.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p391515551189">Description of the API.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</p></li><li id="apig_0080101678__li1048725618253"><span>Configure security settings based on the following table.</span><p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="apig_0080101678__table127581819152716" frame="border" border="1" rules="all"><caption><b>Table 2 </b>API request definition</caption><thead align="left"><tr id="apig_0080101678__row19758019112716"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.3.2.1.2.3.1.1"><p id="apig_0080101678__p107591198276">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.3.2.3.2.1.2.3.1.2"><p id="apig_0080101678__p8759181912272">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="apig_0080101678__row3759111918274"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.3.2.1.2.3.1.1 "><p id="apig_0080101678__p124821629102710">Authentication Mode</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.3.2.1.2.3.1.2 "><p id="apig_0080101678__p1248215292277">API authentication mode. Set this parameter to <strong id="apig_0080101678__en-us_topic_0000001174497011_b883791223419">App</strong>.</p>
</td>
</tr>
<tr id="apig_0080101678__row14759131922711"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.3.2.1.2.3.1.1 "><p id="apig_0080101678__p1529813552273">Simple Authentication</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.3.2.1.2.3.1.2 "><p id="apig_0080101678__p15298555122711">If you enable this option, API Gateway verifies only the AppCode and the request signature does not need to be verified. For this example, enable simple authentication.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="apig_0080101678__li838683282911"><span>Click <strong id="apig_0080101678__b127262155414">Next</strong>.</span></li></ol>
</div>
<div class="section" id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section16484051169"><a name="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section16484051169"></a><a name="en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_section16484051169"></a><h4 class="sectiontitle">Configuring Backend Settings</h4><ol id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_ol54445816305"><li id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_li12956182663810"><span>On the <strong id="apig_0080101678__en-us_topic_0000001174497011_b1875114254589">Backend Configuration</strong> page, set the backend service information.</span></li><li id="apig_0080101678__en-us_topic_0000001174497011_li15901120131017"><span>Select a backend service type. For this example, select <strong id="apig_0080101678__en-us_topic_0000001174497011_b187344195440">HTTP&amp;HTTPS</strong>.</span><p><div class="p" id="apig_0080101678__p1356135173310">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="apig_0080101678__table1561892383315" frame="border" border="1" rules="all"><caption><b>Table 3 </b>HTTP&amp;HTTPS backend service definition</caption><thead align="left"><tr id="apig_0080101678__row8616523183317"><th align="left" class="cellrowborder" valign="top" width="19.97%" id="mcps1.3.4.2.2.2.1.1.2.3.1.1"><p id="apig_0080101678__p1361652315334">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80.03%" id="mcps1.3.4.2.2.2.1.1.2.3.1.2"><p id="apig_0080101678__p86161231331">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="apig_0080101678__row1298892163713"><td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p19617112313335">Load Balance Channel</p>
</td>
<td class="cellrowborder" valign="top" width="80.03%" headers="mcps1.3.4.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p1461792319331">Determine whether the backend service will be accessed using a load balance channel. For this example, select <strong id="apig_0080101678__b1342451385613">Skip</strong>.</p>
</td>
</tr>
<tr id="apig_0080101678__row11800153011379"><td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p1280053015371">URL</p>
</td>
<td class="cellrowborder" valign="top" width="80.03%" headers="mcps1.3.4.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p3800430143716"><strong id="apig_0080101678__b10708181195113">Method</strong>: Request method of the API. Set this parameter to <strong id="apig_0080101678__b1370931116517">POST</strong>.</p>
<p id="apig_0080101678__p777914565379"><strong id="apig_0080101678__b1419815265617">Protocol</strong>: Set this parameter to <strong id="apig_0080101678__b1019835215568">HTTP</strong>. </p>
<p id="apig_0080101678__p9212613143810"><strong id="apig_0080101678__b3965152312579">Backend Address</strong>: Address of the backend service.</p>
<p id="apig_0080101678__p1384242612387"><strong id="apig_0080101678__b9758756105711">Path</strong>: Path of the backend service.</p>
</td>
</tr>
<tr id="apig_0080101678__row8618112310331"><td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.2.2.1.1.2.3.1.1 "><p id="apig_0080101678__p12617192319337">Timeout</p>
</td>
<td class="cellrowborder" valign="top" width="80.03%" headers="mcps1.3.4.2.2.2.1.1.2.3.1.2 "><p id="apig_0080101678__p16617122317332">Backend service request timeout. Default value: 5000 ms.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</p></li><li id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_li830195511431"><span>On the <strong id="apig_0080101678__en-us_topic_0000001174497011_b2026712401516">Define Response</strong> page, set the responses.</span><p><div class="p" id="apig_0080101678__en-us_topic_0000001174497011_p153124013441">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="apig_0080101678__en-us_topic_0000001174497011_table118092018441" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Defining responses</caption><thead align="left"><tr id="apig_0080101678__en-us_topic_0000001174497011_row17180420134411"><th align="left" class="cellrowborder" valign="top" width="28.999999999999996%" id="mcps1.3.4.2.3.2.1.1.2.3.1.1"><p id="apig_0080101678__en-us_topic_0000001174497011_p51808201448">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="71%" id="mcps1.3.4.2.3.2.1.1.2.3.1.2"><p id="apig_0080101678__en-us_topic_0000001174497011_p4180192084420">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="apig_0080101678__en-us_topic_0000001174497011_row1518012018449"><td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.3.4.2.3.2.1.1.2.3.1.1 "><p id="apig_0080101678__en-us_topic_0000001174497011_p4180112020448">Example Success Response</p>
</td>
<td class="cellrowborder" valign="top" width="71%" headers="mcps1.3.4.2.3.2.1.1.2.3.1.2 "><p id="apig_0080101678__en-us_topic_0000001174497011_p51801203447">An example of a response returned when the API is called successfully.</p>
</td>
</tr>
<tr id="apig_0080101678__en-us_topic_0000001174497011_row1518022084420"><td class="cellrowborder" valign="top" width="28.999999999999996%" headers="mcps1.3.4.2.3.2.1.1.2.3.1.1 "><p id="apig_0080101678__en-us_topic_0000001174497011_p5180122011446">Example Failure Response</p>
</td>
<td class="cellrowborder" valign="top" width="71%" headers="mcps1.3.4.2.3.2.1.1.2.3.1.2 "><p id="apig_0080101678__en-us_topic_0000001174497011_p10180182015444">An example of a response returned when the API fails to be called.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</p></li><li id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_li855512342322"><span>Click <strong id="apig_0080101678__en-us_topic_0000001174497011_en-us_topic_0080101678_en-us_topic_0165566289_en-us_topic_0080101678_b14712161820114">Finish</strong>.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="apig-ug-180307001.html">Opening APIs</a></div>
</div>
</div>