<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Talend API Designer Best Practices in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Talend-API-Designer-Best-Practices/ta-p/2151625</link>
    <description>&lt;P&gt;This article describes a set of best practices for Talend API Designer, using a real-world example. These best practices are applicable for the following products and versions running on a cloud environment:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Talend API Designer&lt;/LI&gt;
&lt;LI&gt;Talend Studio R2020-08-7.3.1&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;For information on the functionalities of Talend API Designer, see the &lt;A href="https://help.talend.com/r/qKRY3I02Gk4ak5ZGUlkVTQ/KPnd2e9U3PMwB9JDlPP~Kg" target="_blank" rel="noopener"&gt;Talend Cloud API Designer User Guide&lt;/A&gt; available in the Talend Help Center.&lt;/P&gt;
&lt;P&gt;To better understand these best practices, consider an example use case for designing an API, named &lt;STRONG&gt;Yousubscribe&lt;/STRONG&gt;, based on customers and subscriptions.&lt;/P&gt;
&lt;P&gt;A simplified data model for this API is shown in the table.&lt;/P&gt;
&lt;TABLE style="width: 500px;" border="1"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="lia-align-center" colspan="1" rowspan="1"&gt;Customer&lt;/TH&gt;
&lt;TH class="lia-align-center" colspan="1" rowspan="1"&gt;Subscription_type&lt;/TH&gt;
&lt;TH class="lia-align-center" colspan="1" rowspan="1"&gt;Subscription&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1"&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;id (PK)&lt;/LI&gt;
&lt;LI&gt;email&lt;/LI&gt;
&lt;LI&gt;firstname&lt;/LI&gt;
&lt;LI&gt;lastname&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1"&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;id (PK)&lt;/LI&gt;
&lt;LI&gt;type&lt;/LI&gt;
&lt;LI&gt;price&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1"&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;id (PK)&lt;/LI&gt;
&lt;LI&gt;customer_id (FK)&lt;/LI&gt;
&lt;LI&gt;stype_id (FK)&lt;/LI&gt;
&lt;LI&gt;start_date&lt;/LI&gt;
&lt;LI&gt;end_date&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples of API operations you could design to work with the data model include:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Get user (filter), get user list (filter), create, update (id), delete customer (id)&lt;/LI&gt;
&lt;LI&gt;List subscription_types, get (type), create, update&lt;/LI&gt;
&lt;LI&gt;Create subscription (email, type), delete subscription (id), list subscriptions by users (email)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This document provides examples of how to implement these operations in alignment with best practices.&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;API naming best practices&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;It is important to adopt standard naming conventions for the different artifacts (APIs, resources, and methods) in your API. Some key guidance for naming conventions is shown in the table.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;API&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;Use an explicit name for your API. For example, use the name of the main application.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;API Resource&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;The resource is a business element and must have the name of the business element.&amp;nbsp;&lt;SPAN&gt;A resource is a collection of data, so the name should be plural.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;The resource name is part of the URI; use lowercase with an underscore (_) separator to avoid any confusion with cases and special characters in browsers, in Talend API Tester, and in the code (Talend Studio).&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Path Variable (when used as a subResource)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;When using a path variable to get access to a unique element (such as the customer ID of a customer), use the following syntax: &lt;CODE&gt;/customers/{customer_id}&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;When using a path variable to access data across a relation between two resources (for example, the subscriptions that belong to a customer), use the following syntax: &lt;CODE&gt;/customers/{customer_id}/subscriptions&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Do not use special characters and avoid hyphens (-); use underscores (_) instead. The hyphen (-) character can’t be parsed in a Java variable and requires more coding to refer to it in Talend Studio.&lt;/P&gt;
&lt;P&gt;Example of extra coding if you are using a hyphen:&lt;/P&gt;
&lt;DIV&gt;You have a header,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"Avec-Tiret"&lt;/STRONG&gt;, in your request, and you want to get it and put it in a field, set as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;“avec_tiret”&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in your structure.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM5b000004MHYF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121989i1B37107F4A5B3E43/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM5b000004MHYF.png" alt="0EM5b000004MHYF.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;tJavaRow&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;component after the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;tRESTRequest&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;component with the following code:&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;// Get the request and headers
java.util.Map&amp;lt;String, Object&amp;gt; restReq = ((java.util.Map&amp;lt;String, Object&amp;gt;)globalMap.get("restRequest"));
javax.ws.rs.core.MultivaluedMap&amp;lt;String, String&amp;gt; h = ((javax.ws.rs.core.MultivaluedMap&amp;lt;String, String&amp;gt;) restReq.get("ALL_HEADER_PARAMS"));

// Get the header "Avec-Tiret" in the field "avec_tiret" of my structure
output_row.avec_tiret = h.getFirst("Avec-Tiret")&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM5b000004MHYK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123382i9680329952187509/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM5b000004MHYK.png" alt="0EM5b000004MHYK.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Data Types&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;Use camel case or underscore (_) separators in structure names, such as subscription_list.&lt;/P&gt;
&lt;P&gt;Use JSON format as much as possible because it is the standard for REST APIs. Some applications also use application/xml. It can be added at this level too, and the responses body media types then depend on the Accept header of the requests.&lt;/P&gt;
&lt;P&gt;Avoid complexity in the structure. Simply structures are easier to process (from the server and client side)!&lt;/P&gt;
&lt;P&gt;With Talend API Designer, it is easier to create the structure from an example using the Generate from JSON example link. This way, the structure is created automatically, and you already have an example for the mock.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Using components to reduce duplication&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;Components are an &lt;STRONG&gt;OAS 3.0&lt;/STRONG&gt; feature. You can use them only if you are developing the REST API as a Data Service in Talend Studio, not with web services in Routes because OAS 3.0 is not yet supported. You can only use components if your external API tools, such as your API gateway, are compatible with OAS 3.0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PoEB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123212i9328373C4100BDDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PoEB.png" alt="0EM3p000002PoEB.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Components are common elements that can be used anywhere needed in the contract. Use them as much as possible to reduce duplication and maintenance overhead. In this example, a component called &lt;STRONG&gt;Generic Message&lt;/STRONG&gt; is created to define a generic &lt;STRONG&gt;no content&lt;/STRONG&gt; response. This response, with a &lt;STRONG&gt;204&lt;/STRONG&gt; HTTP code and a specific message body, displays whenever a request query retrieves no data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqB4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124281iC52221C6E8E869ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqB4.png" alt="0EM3p000002PqB4.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using HTTP verbs for operations&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Be sure to use HTTP verbs for operations on the resource based on cross-industry standards, such as POST for create, and PUT or PATCH for update. Examples in the context of the &lt;STRONG&gt;YouSubscribe&lt;/STRONG&gt; API are shown in the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="width: 522.7pt; border-collapse: collapse; border: none;" border="1" width="697" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-bottom: solid #CDD0D3 1.5pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;HTTP Verb&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;CRUD&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="10" width="254" valign="top" style="width: 190.2pt; border: solid #DEE0E1 1.0pt; border-left: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqCH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122074iB865AC5D17A4C3A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqCH.png" alt="0EM3p000002PqCH.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Create&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Create a customer, subscribe a customer&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;GET&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Read&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Get customer’s subscriptions, get subscription types, get subscriptions&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update/replace&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update customer information&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;PATCH&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update/modify&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update subscription price, update subscription end date&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;DELETE&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Delete&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Delete subscription&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;HEAD&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Read&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Same as GET but without the body in the response (headers only)&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;OPTIONS&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Get communication options from the target resource&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not use special characters, for example, an apostrophe (&lt;STRONG&gt;‘&lt;/STRONG&gt;), in the operation description (label).&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using HTTP responses effectively&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Always use standard HTTP response codes to ensure interoperability with connected systems, such as API clients.&lt;/P&gt;
&lt;P&gt;For the &lt;STRONG&gt;YouSubscribe&lt;/STRONG&gt; API, the following response codes are defined to be used globally, that is, for all resources and operations:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Parameters validation: &lt;STRONG&gt;400&lt;/STRONG&gt; (Bad request), &lt;STRONG&gt;406&lt;/STRONG&gt; (Not acceptable)&lt;/LI&gt;
&lt;LI&gt;Security (if required): &lt;STRONG&gt;401&lt;/STRONG&gt; (Unauthorized), &lt;STRONG&gt;403&lt;/STRONG&gt; (Forbidden)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Similarly, define and implement the following response codes for each operation:&lt;/P&gt;
&lt;TABLE class="MsoTable15Grid1LightAccent4" style="width: 650.7pt; border-collapse: collapse; border: none;" border="1" width="897" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-bottom: solid #CDD0D3 1.5pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Operation&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Entire Collection&lt;BR /&gt;(for example, &lt;I&gt;/customers&lt;/I&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Specific Item&lt;BR /&gt;(for example,&lt;I&gt;/customers/{id}&lt;/I&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Comment&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;GET&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK), single customer&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;204&lt;/STRONG&gt; (No Content), for no result&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;206&lt;/STRONG&gt; (Partial Content), if the request is too large to send the entire result, pagination must be used or use &lt;STRONG&gt;303&lt;/STRONG&gt; (See Other) to give the pagination request&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Use pagination, sorting, and filtering to navigate big lists&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;201&lt;/STRONG&gt; (Created)&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;409&lt;/STRONG&gt; (Conflict) if resource already exists&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Location header with a link to &lt;I&gt;/customers/{id}&lt;/I&gt; containing new ID&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;PATCH&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;DELETE&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Catching internal server errors (response code 500)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Internal server errors, represented by the &lt;STRONG&gt;5&lt;I&gt;XX&lt;/I&gt;&lt;/STRONG&gt; series of response codes, must always be intercepted, and an appropriate response should be sent to the client. Because &lt;STRONG&gt;500&lt;/STRONG&gt; response codes usually cannot be handled by clients, it is important to make them more meaningful so they can be understood and processed automatically, for example, by identifying that the error is due to a timeout or a malformed parameter.&lt;/P&gt;
&lt;P&gt;Internal server errors can also leak internal information about the API that you may not want visible to clients.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Organizing your items in Talend API Designer&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;By default, Talend API Designer sorts and organizes your objects by types, and specific icons make them more identifiable. You can also drag and drop to move your elements.&lt;/P&gt;
&lt;P&gt;When dealing with multiple resources, it is a good idea to add “sections” to capture common items, similar to how you use folders with files:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;A section with the &lt;STRONG&gt;&amp;lt;resource name&amp;gt;&lt;/STRONG&gt; to store everything related to the resource&lt;/LI&gt;
&lt;LI&gt;A section named &lt;STRONG&gt;Structures&lt;/STRONG&gt; to store all your data types&lt;/LI&gt;
&lt;LI&gt;A section named &lt;STRONG&gt;Operations&lt;/STRONG&gt; to store all your resources and operations&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;You can see this arrangement for the &lt;STRONG&gt;YouSubscribe&lt;/STRONG&gt; API:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; border: none;" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="232" valign="top" style="width: 174.2pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="text-align: left;" align="left"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QFkd.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124094i666D5F50C702E1FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QFkd.png" alt="0EM3p000002QFkd.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="232" valign="top" style="width: 174.25pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="text-align: center;" align="center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QFlH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124857i1804453EA49FD93F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QFlH.png" alt="0EM3p000002QFlH.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="232" valign="top" style="width: 174.25pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="text-align: right;" align="right"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QFlR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122522i8BAB6D4B0543702B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QFlR.png" alt="0EM3p000002QFlR.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Protecting against SQL injection&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;SQL injection is a common security breach involving APIs. Always decorrelate the attributes of the responses from the attributes of your data store. Do not directly expose the names of your database fields (attributes if you are using NoSQL) directly in your API responses.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using query parameters appropriately&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Use query parameters for the following scenarios:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;STRONG&gt;Filters&lt;/STRONG&gt;: for example, to return only “gold level” subscriptions, use &lt;I&gt;/subscriptions?type=gold&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Pagination&lt;/STRONG&gt;: for example, for a total of 250 elements:
&lt;UL&gt;
&lt;LI&gt;&lt;I&gt;/subscriptions?page=1&amp;amp;limit=100 -&amp;gt; Get the range 1-100&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;/subscriptions?page=2&amp;amp;limit=100 -&amp;gt; Get the range 101-200&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;/subscriptions?page=3&amp;amp;limit=100 -&amp;gt; Get the range 201-250&lt;/I&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Sorting&lt;/STRONG&gt;: for example, to sort subscriptions in descending order, use &lt;I&gt;/subscriptions?sort=desc&lt;/I&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Do not use special characters in query parameter names, and use underscores (_) instead of hyphens (-). The hyphen (-) character cannot be parsed as a Java variable and requires specific code in Talend Studio as a workaround.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using pagination correctly&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Use pagination when the response has a lot of elements. There are multiple ways to handle pagination; the best way depends on client needs.&lt;/P&gt;
&lt;P&gt;A common practice is to use &lt;STRONG&gt;limit&lt;/STRONG&gt; and &lt;STRONG&gt;offset &lt;/STRONG&gt;(or &lt;STRONG&gt;page&lt;/STRONG&gt;) query parameters in the request. For example, to return the second page of 100 subscriptions, use &lt;I&gt;/subscriptions?offset=100&amp;amp;limit=100&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;When you use pagination, also make use of HTTP response codes that highlight issues or the status of the request, including:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;STRONG&gt;206 &lt;/STRONG&gt;(Partial Content) is used if the &lt;STRONG&gt;limit &lt;/STRONG&gt;query parameter is not found or is too high and the default max limit is reached.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;303 &lt;/STRONG&gt;(See Other) is used with the &lt;STRONG&gt;Location&lt;/STRONG&gt; header, including the request with the limit and offset parameter.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In the response header, set the &lt;STRONG&gt;next&lt;/STRONG&gt; value (next offset or next page) and the navigation links (previous URL, next URL) to loop until the end of the list.&lt;/P&gt;
&lt;P&gt;You can also use the HTTP response headers to store additional information about the pagination state, for example, &lt;I&gt;Content-Range: offset-limit/count&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;However it is implemented, pagination implies multiple calls, so the queries must always return the same result. Having the same (and absolute) sort key is mandatory.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Versioning&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Talend recommends including the version in the API path, for example, &lt;I&gt;/yousubscribe/v1/&lt;/I&gt;. The relative path, &lt;STRONG&gt;v1&lt;/STRONG&gt;, is defined in Talend Studio according to the API definition version (for example, 1.0.0).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: Use &lt;I&gt;/something/v1/&lt;/I&gt; in the URI, not simply &lt;I&gt;/v1/&amp;lt;resource&amp;gt;&lt;/I&gt;. Otherwise, you will have endpoint conflicts if you deploy several APIs in a Runtime.&lt;/P&gt;
&lt;P&gt;To avoid managing too many versions, change the API version only when there is an impact for the client. You will expose a new endpoint with the v2 URL, and both v1 and v2 will be available. For example, you may want to create a new version when there is a new relative endpoint, new mandatory parameter, or new outputs. However, you might not want a new version for optimizations, optional parameters, operations, or new resources.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: As much as possible, try to have backward compatibility to keep the current version.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Creating a new version&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;Create the new version from a previous version.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QINw.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123655i042502B7500DCFB2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QINw.png" alt="0EM3p000002QINw.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Configure the new version, then click &lt;STRONG&gt;Create&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QIOG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121830i95BBC3838958C3F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QIOG.png" alt="0EM3p000002QIOG.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QIOL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123027i8EDA8A94189FF4B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QIOL.png" alt="0EM3p000002QIOL.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;In Talend Studio, duplicate the &lt;STRONG&gt;Yousubscribe_v1&lt;/STRONG&gt; Job or Route in &lt;STRONG&gt;Yousubscribe_v2&lt;/STRONG&gt;, and change the &lt;STRONG&gt;tRestRequest&lt;/STRONG&gt; or &lt;STRONG&gt;cRest&lt;/STRONG&gt; endpoint accordingly. Update the REST API contract to &lt;STRONG&gt;Yousubscribe 2.0.0&lt;/STRONG&gt; in Talend API Designer.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QIOV.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121548i06596FFBFEB0C76E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QIOV.png" alt="0EM3p000002QIOV.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Generating documentation easily&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Talend API Designer generates documentation automatically, based on all elements of the design.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqCh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124684iDC0291B7887D156E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqCh.png" alt="0EM3p000002PqCh.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqGO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122286i3B4212BB7A8FEF3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqGO.png" alt="0EM3p000002PqGO.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To improve the documentation quality, fill in the descriptions and examples.&lt;/P&gt;
&lt;P&gt;Add text elements to include additional information, such as an &lt;STRONG&gt;About&lt;/STRONG&gt; section.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqHg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122188i181684B4B98A6ED0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqHg.png" alt="0EM3p000002PqHg.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqHq.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123410i4CD0ABB710A5BB16/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqHq.png" alt="0EM3p000002PqHq.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Summary&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;This article introduced some best practices for using Talend API Designer to implement APIs.&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 23 Jan 2024 02:35:30 GMT</pubDate>
    <dc:creator>TalendSolutionExpert</dc:creator>
    <dc:date>2024-01-23T02:35:30Z</dc:date>
    <item>
      <title>Talend API Designer Best Practices</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Talend-API-Designer-Best-Practices/ta-p/2151625</link>
      <description>&lt;P&gt;This article describes a set of best practices for Talend API Designer, using a real-world example. These best practices are applicable for the following products and versions running on a cloud environment:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Talend API Designer&lt;/LI&gt;
&lt;LI&gt;Talend Studio R2020-08-7.3.1&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;For information on the functionalities of Talend API Designer, see the &lt;A href="https://help.talend.com/r/qKRY3I02Gk4ak5ZGUlkVTQ/KPnd2e9U3PMwB9JDlPP~Kg" target="_blank" rel="noopener"&gt;Talend Cloud API Designer User Guide&lt;/A&gt; available in the Talend Help Center.&lt;/P&gt;
&lt;P&gt;To better understand these best practices, consider an example use case for designing an API, named &lt;STRONG&gt;Yousubscribe&lt;/STRONG&gt;, based on customers and subscriptions.&lt;/P&gt;
&lt;P&gt;A simplified data model for this API is shown in the table.&lt;/P&gt;
&lt;TABLE style="width: 500px;" border="1"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="lia-align-center" colspan="1" rowspan="1"&gt;Customer&lt;/TH&gt;
&lt;TH class="lia-align-center" colspan="1" rowspan="1"&gt;Subscription_type&lt;/TH&gt;
&lt;TH class="lia-align-center" colspan="1" rowspan="1"&gt;Subscription&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1"&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;id (PK)&lt;/LI&gt;
&lt;LI&gt;email&lt;/LI&gt;
&lt;LI&gt;firstname&lt;/LI&gt;
&lt;LI&gt;lastname&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1"&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;id (PK)&lt;/LI&gt;
&lt;LI&gt;type&lt;/LI&gt;
&lt;LI&gt;price&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1"&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;id (PK)&lt;/LI&gt;
&lt;LI&gt;customer_id (FK)&lt;/LI&gt;
&lt;LI&gt;stype_id (FK)&lt;/LI&gt;
&lt;LI&gt;start_date&lt;/LI&gt;
&lt;LI&gt;end_date&lt;/LI&gt;
&lt;/UL&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples of API operations you could design to work with the data model include:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Get user (filter), get user list (filter), create, update (id), delete customer (id)&lt;/LI&gt;
&lt;LI&gt;List subscription_types, get (type), create, update&lt;/LI&gt;
&lt;LI&gt;Create subscription (email, type), delete subscription (id), list subscriptions by users (email)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This document provides examples of how to implement these operations in alignment with best practices.&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;API naming best practices&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;It is important to adopt standard naming conventions for the different artifacts (APIs, resources, and methods) in your API. Some key guidance for naming conventions is shown in the table.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;API&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;Use an explicit name for your API. For example, use the name of the main application.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;API Resource&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;The resource is a business element and must have the name of the business element.&amp;nbsp;&lt;SPAN&gt;A resource is a collection of data, so the name should be plural.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;The resource name is part of the URI; use lowercase with an underscore (_) separator to avoid any confusion with cases and special characters in browsers, in Talend API Tester, and in the code (Talend Studio).&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Path Variable (when used as a subResource)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;When using a path variable to get access to a unique element (such as the customer ID of a customer), use the following syntax: &lt;CODE&gt;/customers/{customer_id}&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;When using a path variable to access data across a relation between two resources (for example, the subscriptions that belong to a customer), use the following syntax: &lt;CODE&gt;/customers/{customer_id}/subscriptions&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Do not use special characters and avoid hyphens (-); use underscores (_) instead. The hyphen (-) character can’t be parsed in a Java variable and requires more coding to refer to it in Talend Studio.&lt;/P&gt;
&lt;P&gt;Example of extra coding if you are using a hyphen:&lt;/P&gt;
&lt;DIV&gt;You have a header,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"Avec-Tiret"&lt;/STRONG&gt;, in your request, and you want to get it and put it in a field, set as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;“avec_tiret”&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in your structure.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM5b000004MHYF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121989i1B37107F4A5B3E43/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM5b000004MHYF.png" alt="0EM5b000004MHYF.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;tJavaRow&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;component after the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;tRESTRequest&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;component with the following code:&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;// Get the request and headers
java.util.Map&amp;lt;String, Object&amp;gt; restReq = ((java.util.Map&amp;lt;String, Object&amp;gt;)globalMap.get("restRequest"));
javax.ws.rs.core.MultivaluedMap&amp;lt;String, String&amp;gt; h = ((javax.ws.rs.core.MultivaluedMap&amp;lt;String, String&amp;gt;) restReq.get("ALL_HEADER_PARAMS"));

// Get the header "Avec-Tiret" in the field "avec_tiret" of my structure
output_row.avec_tiret = h.getFirst("Avec-Tiret")&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM5b000004MHYK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123382i9680329952187509/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM5b000004MHYK.png" alt="0EM5b000004MHYK.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Data Types&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;Use camel case or underscore (_) separators in structure names, such as subscription_list.&lt;/P&gt;
&lt;P&gt;Use JSON format as much as possible because it is the standard for REST APIs. Some applications also use application/xml. It can be added at this level too, and the responses body media types then depend on the Accept header of the requests.&lt;/P&gt;
&lt;P&gt;Avoid complexity in the structure. Simply structures are easier to process (from the server and client side)!&lt;/P&gt;
&lt;P&gt;With Talend API Designer, it is easier to create the structure from an example using the Generate from JSON example link. This way, the structure is created automatically, and you already have an example for the mock.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Using components to reduce duplication&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;Components are an &lt;STRONG&gt;OAS 3.0&lt;/STRONG&gt; feature. You can use them only if you are developing the REST API as a Data Service in Talend Studio, not with web services in Routes because OAS 3.0 is not yet supported. You can only use components if your external API tools, such as your API gateway, are compatible with OAS 3.0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PoEB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123212i9328373C4100BDDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PoEB.png" alt="0EM3p000002PoEB.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Components are common elements that can be used anywhere needed in the contract. Use them as much as possible to reduce duplication and maintenance overhead. In this example, a component called &lt;STRONG&gt;Generic Message&lt;/STRONG&gt; is created to define a generic &lt;STRONG&gt;no content&lt;/STRONG&gt; response. This response, with a &lt;STRONG&gt;204&lt;/STRONG&gt; HTTP code and a specific message body, displays whenever a request query retrieves no data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqB4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124281iC52221C6E8E869ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqB4.png" alt="0EM3p000002PqB4.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using HTTP verbs for operations&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Be sure to use HTTP verbs for operations on the resource based on cross-industry standards, such as POST for create, and PUT or PATCH for update. Examples in the context of the &lt;STRONG&gt;YouSubscribe&lt;/STRONG&gt; API are shown in the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="width: 522.7pt; border-collapse: collapse; border: none;" border="1" width="697" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-bottom: solid #CDD0D3 1.5pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;HTTP Verb&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;CRUD&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Description&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="10" width="254" valign="top" style="width: 190.2pt; border: solid #DEE0E1 1.0pt; border-left: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqCH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122074iB865AC5D17A4C3A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqCH.png" alt="0EM3p000002PqCH.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Create&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Create a customer, subscribe a customer&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;GET&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Read&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Get customer’s subscriptions, get subscription types, get subscriptions&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update/replace&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update customer information&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;PATCH&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update/modify&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Update subscription price, update subscription end date&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;DELETE&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Delete&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;Delete subscription&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;HEAD&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Read&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Same as GET but without the body in the response (headers only)&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.3pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;OPTIONS&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="100" valign="top" style="width: 75.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="277" valign="top" style="width: 208.1pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Get communication options from the target resource&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not use special characters, for example, an apostrophe (&lt;STRONG&gt;‘&lt;/STRONG&gt;), in the operation description (label).&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using HTTP responses effectively&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Always use standard HTTP response codes to ensure interoperability with connected systems, such as API clients.&lt;/P&gt;
&lt;P&gt;For the &lt;STRONG&gt;YouSubscribe&lt;/STRONG&gt; API, the following response codes are defined to be used globally, that is, for all resources and operations:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Parameters validation: &lt;STRONG&gt;400&lt;/STRONG&gt; (Bad request), &lt;STRONG&gt;406&lt;/STRONG&gt; (Not acceptable)&lt;/LI&gt;
&lt;LI&gt;Security (if required): &lt;STRONG&gt;401&lt;/STRONG&gt; (Unauthorized), &lt;STRONG&gt;403&lt;/STRONG&gt; (Forbidden)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Similarly, define and implement the following response codes for each operation:&lt;/P&gt;
&lt;TABLE class="MsoTable15Grid1LightAccent4" style="width: 650.7pt; border-collapse: collapse; border: none;" border="1" width="897" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-bottom: solid #CDD0D3 1.5pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Operation&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Entire Collection&lt;BR /&gt;(for example, &lt;I&gt;/customers&lt;/I&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Specific Item&lt;BR /&gt;(for example,&lt;I&gt;/customers/{id}&lt;/I&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: solid #DEE0E1 1.0pt; border-left: none; border-bottom: solid #CDD0D3 1.5pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;Comment&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;GET&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK), single customer&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;204&lt;/STRONG&gt; (No Content), for no result&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;206&lt;/STRONG&gt; (Partial Content), if the request is too large to send the entire result, pagination must be used or use &lt;STRONG&gt;303&lt;/STRONG&gt; (See Other) to give the pagination request&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Use pagination, sorting, and filtering to navigate big lists&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;POST&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;201&lt;/STRONG&gt; (Created)&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;409&lt;/STRONG&gt; (Conflict) if resource already exists&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;Location header with a link to &lt;I&gt;/customers/{id}&lt;/I&gt; containing new ID&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P class="MsoNormal" style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;PATCH&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="66" valign="top" style="width: 49.4pt; border: solid #DEE0E1 1.0pt; border-top: none; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;DELETE&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="189" valign="top" style="width: 141.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;NA (unless operation for entire collection)&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="264" valign="top" style="width: 197.8pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&lt;STRONG&gt;200&lt;/STRONG&gt; (OK)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;404&lt;/STRONG&gt; (Not Found), if ID not found or invalid&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="178" valign="top" style="width: 133.75pt; border-top: none; border-left: none; border-bottom: solid #DEE0E1 1.0pt; border-right: solid #DEE0E1 1.0pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Catching internal server errors (response code 500)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Internal server errors, represented by the &lt;STRONG&gt;5&lt;I&gt;XX&lt;/I&gt;&lt;/STRONG&gt; series of response codes, must always be intercepted, and an appropriate response should be sent to the client. Because &lt;STRONG&gt;500&lt;/STRONG&gt; response codes usually cannot be handled by clients, it is important to make them more meaningful so they can be understood and processed automatically, for example, by identifying that the error is due to a timeout or a malformed parameter.&lt;/P&gt;
&lt;P&gt;Internal server errors can also leak internal information about the API that you may not want visible to clients.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Organizing your items in Talend API Designer&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;By default, Talend API Designer sorts and organizes your objects by types, and specific icons make them more identifiable. You can also drag and drop to move your elements.&lt;/P&gt;
&lt;P&gt;When dealing with multiple resources, it is a good idea to add “sections” to capture common items, similar to how you use folders with files:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;A section with the &lt;STRONG&gt;&amp;lt;resource name&amp;gt;&lt;/STRONG&gt; to store everything related to the resource&lt;/LI&gt;
&lt;LI&gt;A section named &lt;STRONG&gt;Structures&lt;/STRONG&gt; to store all your data types&lt;/LI&gt;
&lt;LI&gt;A section named &lt;STRONG&gt;Operations&lt;/STRONG&gt; to store all your resources and operations&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;You can see this arrangement for the &lt;STRONG&gt;YouSubscribe&lt;/STRONG&gt; API:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; border: none;" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD colspan="1" rowspan="1" width="232" valign="top" style="width: 174.2pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="text-align: left;" align="left"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QFkd.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124094i666D5F50C702E1FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QFkd.png" alt="0EM3p000002QFkd.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="232" valign="top" style="width: 174.25pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="text-align: center;" align="center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QFlH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124857i1804453EA49FD93F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QFlH.png" alt="0EM3p000002QFlH.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD colspan="1" rowspan="1" width="232" valign="top" style="width: 174.25pt; padding: 0in 5.4pt 0in 5.4pt;"&gt;
&lt;P style="text-align: right;" align="right"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QFlR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122522i8BAB6D4B0543702B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QFlR.png" alt="0EM3p000002QFlR.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Protecting against SQL injection&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;SQL injection is a common security breach involving APIs. Always decorrelate the attributes of the responses from the attributes of your data store. Do not directly expose the names of your database fields (attributes if you are using NoSQL) directly in your API responses.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using query parameters appropriately&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Use query parameters for the following scenarios:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;STRONG&gt;Filters&lt;/STRONG&gt;: for example, to return only “gold level” subscriptions, use &lt;I&gt;/subscriptions?type=gold&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Pagination&lt;/STRONG&gt;: for example, for a total of 250 elements:
&lt;UL&gt;
&lt;LI&gt;&lt;I&gt;/subscriptions?page=1&amp;amp;limit=100 -&amp;gt; Get the range 1-100&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;/subscriptions?page=2&amp;amp;limit=100 -&amp;gt; Get the range 101-200&lt;/I&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;I&gt;/subscriptions?page=3&amp;amp;limit=100 -&amp;gt; Get the range 201-250&lt;/I&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Sorting&lt;/STRONG&gt;: for example, to sort subscriptions in descending order, use &lt;I&gt;/subscriptions?sort=desc&lt;/I&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Do not use special characters in query parameter names, and use underscores (_) instead of hyphens (-). The hyphen (-) character cannot be parsed as a Java variable and requires specific code in Talend Studio as a workaround.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Using pagination correctly&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Use pagination when the response has a lot of elements. There are multiple ways to handle pagination; the best way depends on client needs.&lt;/P&gt;
&lt;P&gt;A common practice is to use &lt;STRONG&gt;limit&lt;/STRONG&gt; and &lt;STRONG&gt;offset &lt;/STRONG&gt;(or &lt;STRONG&gt;page&lt;/STRONG&gt;) query parameters in the request. For example, to return the second page of 100 subscriptions, use &lt;I&gt;/subscriptions?offset=100&amp;amp;limit=100&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;When you use pagination, also make use of HTTP response codes that highlight issues or the status of the request, including:&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;STRONG&gt;206 &lt;/STRONG&gt;(Partial Content) is used if the &lt;STRONG&gt;limit &lt;/STRONG&gt;query parameter is not found or is too high and the default max limit is reached.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;303 &lt;/STRONG&gt;(See Other) is used with the &lt;STRONG&gt;Location&lt;/STRONG&gt; header, including the request with the limit and offset parameter.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In the response header, set the &lt;STRONG&gt;next&lt;/STRONG&gt; value (next offset or next page) and the navigation links (previous URL, next URL) to loop until the end of the list.&lt;/P&gt;
&lt;P&gt;You can also use the HTTP response headers to store additional information about the pagination state, for example, &lt;I&gt;Content-Range: offset-limit/count&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;However it is implemented, pagination implies multiple calls, so the queries must always return the same result. Having the same (and absolute) sort key is mandatory.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Versioning&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Talend recommends including the version in the API path, for example, &lt;I&gt;/yousubscribe/v1/&lt;/I&gt;. The relative path, &lt;STRONG&gt;v1&lt;/STRONG&gt;, is defined in Talend Studio according to the API definition version (for example, 1.0.0).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: Use &lt;I&gt;/something/v1/&lt;/I&gt; in the URI, not simply &lt;I&gt;/v1/&amp;lt;resource&amp;gt;&lt;/I&gt;. Otherwise, you will have endpoint conflicts if you deploy several APIs in a Runtime.&lt;/P&gt;
&lt;P&gt;To avoid managing too many versions, change the API version only when there is an impact for the client. You will expose a new endpoint with the v2 URL, and both v1 and v2 will be available. For example, you may want to create a new version when there is a new relative endpoint, new mandatory parameter, or new outputs. However, you might not want a new version for optimizations, optional parameters, operations, or new resources.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: As much as possible, try to have backward compatibility to keep the current version.&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Creating a new version&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;Create the new version from a previous version.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QINw.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123655i042502B7500DCFB2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QINw.png" alt="0EM3p000002QINw.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Configure the new version, then click &lt;STRONG&gt;Create&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QIOG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121830i95BBC3838958C3F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QIOG.png" alt="0EM3p000002QIOG.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QIOL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123027i8EDA8A94189FF4B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QIOL.png" alt="0EM3p000002QIOL.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;In Talend Studio, duplicate the &lt;STRONG&gt;Yousubscribe_v1&lt;/STRONG&gt; Job or Route in &lt;STRONG&gt;Yousubscribe_v2&lt;/STRONG&gt;, and change the &lt;STRONG&gt;tRestRequest&lt;/STRONG&gt; or &lt;STRONG&gt;cRest&lt;/STRONG&gt; endpoint accordingly. Update the REST API contract to &lt;STRONG&gt;Yousubscribe 2.0.0&lt;/STRONG&gt; in Talend API Designer.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002QIOV.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121548i06596FFBFEB0C76E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002QIOV.png" alt="0EM3p000002QIOV.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Generating documentation easily&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Talend API Designer generates documentation automatically, based on all elements of the design.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqCh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124684iDC0291B7887D156E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqCh.png" alt="0EM3p000002PqCh.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqGO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122286i3B4212BB7A8FEF3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqGO.png" alt="0EM3p000002PqGO.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To improve the documentation quality, fill in the descriptions and examples.&lt;/P&gt;
&lt;P&gt;Add text elements to include additional information, such as an &lt;STRONG&gt;About&lt;/STRONG&gt; section.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqHg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122188i181684B4B98A6ED0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqHg.png" alt="0EM3p000002PqHg.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0EM3p000002PqHq.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123410i4CD0ABB710A5BB16/image-size/large?v=v2&amp;amp;px=999" role="button" title="0EM3p000002PqHq.png" alt="0EM3p000002PqHq.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Summary&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;This article introduced some best practices for using Talend API Designer to implement APIs.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jan 2024 02:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Talend-API-Designer-Best-Practices/ta-p/2151625</guid>
      <dc:creator>TalendSolutionExpert</dc:creator>
      <dc:date>2024-01-23T02:35:30Z</dc:date>
    </item>
  </channel>
</rss>

