forked from docs/doc-exports
Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
125 lines
11 KiB
HTML
125 lines
11 KiB
HTML
<a name="EN-US_TOPIC_0036017300"></a><a name="EN-US_TOPIC_0036017300"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Topic</h1>
|
|
<div id="body1471602451369"><div class="section" id="EN-US_TOPIC_0036017300__section9931723184157"><h4 class="sectiontitle">Description</h4><ul id="EN-US_TOPIC_0036017300__ul33304380203733"><li id="EN-US_TOPIC_0036017300__li51147505203733">API name<p id="EN-US_TOPIC_0036017300__p38624841203741"><a name="EN-US_TOPIC_0036017300__li51147505203733"></a><a name="li51147505203733"></a>CreateTopic</p>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0036017300__ul20998054203745"><li id="EN-US_TOPIC_0036017300__li46884910203750">Function<p id="EN-US_TOPIC_0036017300__p1140531617157"><a name="EN-US_TOPIC_0036017300__li46884910203750"></a><a name="li46884910203750"></a>Create a topic. Each user can create 3,000 topics at most. In the high-concurrent scenario, a user may create a few topics more than 3,000.</p>
|
|
<p id="EN-US_TOPIC_0036017300__p48152936164242">The API is idempotent. It returns a successful result after creating a topic. If a topic of the same name already exists, the status code is 200. Otherwise, the status code is 201.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036017300__section59578064184157"><h4 class="sectiontitle">URI</h4><ul id="EN-US_TOPIC_0036017300__ul61093893184157"><li id="EN-US_TOPIC_0036017300__li12974127184157">URI format<p id="EN-US_TOPIC_0036017300__p49658286184157"><a name="EN-US_TOPIC_0036017300__li12974127184157"></a><a name="li12974127184157"></a>POST /v2/{project_id}/notifications/topics</p>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0036017300__ul44271394184157"><li id="EN-US_TOPIC_0036017300__li62898228184157">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036017300__table29213141184157" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036017300__row19251397184157"><th align="left" class="cellrowborder" valign="top" width="25.25747425257474%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="EN-US_TOPIC_0036017300__p15859347184157"><strong id="EN-US_TOPIC_0036017300__b842352706191030">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.33756624337566%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="EN-US_TOPIC_0036017300__p9538705184157"><strong id="EN-US_TOPIC_0036017300__b842352706191051">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.13768623137686%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="EN-US_TOPIC_0036017300__p34437607184157"><strong id="EN-US_TOPIC_0036017300__b84235270619112">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="27.267273272672732%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="EN-US_TOPIC_0036017300__p37982782184157"><strong id="EN-US_TOPIC_0036017300__b84235270619115">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036017300__row29823245184157"><td class="cellrowborder" valign="top" width="25.25747425257474%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036017300__p66872662184157">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.33756624337566%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036017300__p47976511184157">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.13768623137686%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036017300__p60892144184157">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="27.267273272672732%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036017300__p59334239154910">Project ID</p>
|
|
<p id="EN-US_TOPIC_0036017300__p33316626184157">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036017300__section16815303184157"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0036017300__ul19862315184157"><li id="EN-US_TOPIC_0036017300__li44543107184157">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036017300__table65343646184157" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036017300__row24199091184157"><th align="left" class="cellrowborder" valign="top" width="21.10788921107889%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0036017300__p13969361184157"><strong id="EN-US_TOPIC_0036017300__b551932098">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.897610238976103%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0036017300__p57776496184157"><strong id="EN-US_TOPIC_0036017300__b6239563592942">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="22.377762223777623%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0036017300__p49384632184157"><strong id="EN-US_TOPIC_0036017300__b1006694529">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="32.61673832616738%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0036017300__p40732240184157"><strong id="EN-US_TOPIC_0036017300__b290810480">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036017300__row16731537184157"><td class="cellrowborder" valign="top" width="21.10788921107889%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036017300__p13077258184157">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.897610238976103%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036017300__p52625012184157">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.377762223777623%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036017300__p44473009184157">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.61673832616738%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036017300__p45543947184157">Name of the topic</p>
|
|
<p id="EN-US_TOPIC_0036017300__p979550192113">Enter 1 to 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The topic name must start with a letter or digit.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036017300__row49758753184157"><td class="cellrowborder" valign="top" width="21.10788921107889%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036017300__p3927189184157">display_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.897610238976103%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036017300__p49666922184157">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.377762223777623%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036017300__p35509001184157">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.61673832616738%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036017300__p6330530816482">Topic display name, which is presented as the name of the email sender in email messages</p>
|
|
<p id="EN-US_TOPIC_0036017300__p11282828192211">The display name cannot exceed 192 bytes.</p>
|
|
<p id="EN-US_TOPIC_0036017300__p7371996273"><strong id="EN-US_TOPIC_0036017300__b18926181081110">display_name</strong> is left blank by default.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0036017300__ul60961342184157"><li id="EN-US_TOPIC_0036017300__li11781170184157">Example request<pre class="screen" id="EN-US_TOPIC_0036017300__screen10393855104059">POST https://{SMN_Endpoint}/v2/{project_id}/notifications/topics</pre>
|
|
<pre class="screen" id="EN-US_TOPIC_0036017300__screen3274914218548">{
|
|
"name": "test_topic_v2",
|
|
"display_name": "testtest"
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036017300__section26706597184157"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0036017300__ul15750743184157"><li id="EN-US_TOPIC_0036017300__li7538961184157">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036017300__table741793184157" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036017300__row65023299184157"><th align="left" class="cellrowborder" valign="top" width="21.13%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0036017300__p32395875184157"><strong id="EN-US_TOPIC_0036017300__b2144402333">Parameter</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="24.6%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0036017300__p6820199184157"><strong id="EN-US_TOPIC_0036017300__b2144295771">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.269999999999996%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0036017300__p15565240184157"><strong id="EN-US_TOPIC_0036017300__b1034673197">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036017300__row50957918184157"><td class="cellrowborder" valign="top" width="21.13%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036017300__p33950725184157">request_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.6%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036017300__p65654167184157">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.269999999999996%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036017300__p16387326184157">Request ID, which is unique</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036017300__row983478184157"><td class="cellrowborder" valign="top" width="21.13%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036017300__p12552895184157">topic_urn</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="24.6%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036017300__p10151609184157">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.269999999999996%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036017300__p16974028184157">Unique resource ID of a topic. You can obtain it by referring to <a href="en-us_topic_0036016755.html">Querying Topics</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0036017300__ul32993882184157"><li id="EN-US_TOPIC_0036017300__li28509486184157">Example response<pre class="screen" id="EN-US_TOPIC_0036017300__screen1569734185427">{
|
|
"request_id": "6a63a18b8bab40ffb71ebd9cb80d0085",
|
|
"topic_urn": "urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2"
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036017300__section15080701184157"><h4 class="sectiontitle">Returned Value</h4><p id="EN-US_TOPIC_0036017300__p13577243184157">See <a href="smn_api_63002.html">Returned Value</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036017300__section73211020122511"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0036017300__p9759142919265">See <a href="smn_api_64000.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="smn_api_51000.html">Topic Operations</a></div>
|
|
</div>
|
|
</div>
|
|
|