doc-exports/docs/smn/api-ref/en-us_topic_0036016755.html
Zaoxu, Li 152a7d9381 SMN API DOC
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>
2024-06-20 15:01:38 +00:00

170 lines
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0036016755"></a><a name="EN-US_TOPIC_0036016755"></a>
<h1 class="topictitle1">Querying Topics</h1>
<div id="body7204713"><div class="section" id="EN-US_TOPIC_0036016755__en-us_topic_0025373767-chtext"><h4 class="sectiontitle">Description</h4><ul id="EN-US_TOPIC_0036016755__ul33304380203733"><li id="EN-US_TOPIC_0036016755__li51147505203733">API name<p id="EN-US_TOPIC_0036016755__p38624841203741"><a name="EN-US_TOPIC_0036016755__li51147505203733"></a><a name="li51147505203733"></a>ListTopics</p>
</li></ul>
<ul id="EN-US_TOPIC_0036016755__ul20998054203745"><li id="EN-US_TOPIC_0036016755__li46884910203750">Function<p id="EN-US_TOPIC_0036016755__p2178318594456"><a name="EN-US_TOPIC_0036016755__li46884910203750"></a><a name="li46884910203750"></a>Query the topics by page. The topics are sorted by the creation time in descending order. When querying the topics by page, you can specify <strong id="EN-US_TOPIC_0036016755__b34391393418">offset</strong> and <strong id="EN-US_TOPIC_0036016755__b1211178123416">limit</strong>. If no topic has been created, an empty list is returned.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0036016755__section30715040"><h4 class="sectiontitle">URI</h4><ul id="EN-US_TOPIC_0036016755__ul25483595"><li id="EN-US_TOPIC_0036016755__li28025763">URI format<p id="EN-US_TOPIC_0036016755__p1715310221219"><a name="EN-US_TOPIC_0036016755__li28025763"></a><a name="li28025763"></a>GET /v2/{project_id}/notifications/topics?offset={offset}&amp;limit={limit}</p>
</li></ul>
<ul id="EN-US_TOPIC_0036016755__ul55494360"><li id="EN-US_TOPIC_0036016755__li29687198">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036016755__table65858198" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036016755__row16627584"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="EN-US_TOPIC_0036016755__p4657088"><strong id="EN-US_TOPIC_0036016755__b842352706191030">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="EN-US_TOPIC_0036016755__p41679865"><strong id="EN-US_TOPIC_0036016755__b593421527191713">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.650000000000002%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="EN-US_TOPIC_0036016755__p20625874"><strong id="EN-US_TOPIC_0036016755__b84235270619112">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.35%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="EN-US_TOPIC_0036016755__p60083059"><strong id="EN-US_TOPIC_0036016755__b84235270619115">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036016755__row7485743"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036016755__p2365466">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036016755__p57385070">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036016755__p17679057">String</p>
</td>
<td class="cellrowborder" valign="top" width="27.35%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036016755__p12240680154940">Project ID</p>
<p id="EN-US_TOPIC_0036016755__p22717550">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row52313669"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036016755__p9548790">offset</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036016755__p2088631120211">No</p>
</td>
<td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036016755__p37041500">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="27.35%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036016755__p146581828102110">Offset</p>
<p id="EN-US_TOPIC_0036016755__p21821344207">If the offset is an integer greater than 0 but less than the number of resources, all resources after this offset will be queried. The default offset is <strong id="EN-US_TOPIC_0036016755__b49534518528">0</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row51489795"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036016755__p9923843">limit</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036016755__p65633828">No</p>
</td>
<td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036016755__p14739853">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="27.35%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><ul id="EN-US_TOPIC_0036016755__ul38160342182720"><li id="EN-US_TOPIC_0036016755__li7898765182720">Number of resources returned on each page</li><li id="EN-US_TOPIC_0036016755__li35820204182720">Value range: 1100<p id="EN-US_TOPIC_0036016755__p683218308526"><a name="EN-US_TOPIC_0036016755__li35820204182720"></a><a name="li35820204182720"></a>Commonly used numbers are <strong id="EN-US_TOPIC_0036016755__b85981650205215">10</strong>, <strong id="EN-US_TOPIC_0036016755__b106551253205216">20</strong>, and <strong id="EN-US_TOPIC_0036016755__b11116125714526">50</strong>.</p>
<p id="EN-US_TOPIC_0036016755__p18225173316526">The default number is <strong id="EN-US_TOPIC_0036016755__b842352706165234">100</strong>.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0036016755__section7999906"><h4 class="sectiontitle">Request</h4><div class="p" id="EN-US_TOPIC_0036016755__p29034848191242">Example request<pre class="screen" id="EN-US_TOPIC_0036016755__screen22083013104528">GET https://{SMN_Endpoint}/v2/{project_id}/notifications/topics?offset=0&amp;limit=100</pre>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0036016755__section4890297"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0036016755__ul46802360"><li id="EN-US_TOPIC_0036016755__li18568063">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036016755__table32894845" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036016755__row40748571"><th align="left" class="cellrowborder" valign="top" width="31.59%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0036016755__p12299945"><strong id="EN-US_TOPIC_0036016755__b1836569662">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.59%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0036016755__p56771492"><strong id="EN-US_TOPIC_0036016755__b55509525">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.82%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0036016755__p35088115"><strong id="EN-US_TOPIC_0036016755__b792111809">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036016755__row29721263"><td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036016755__p58612075">request_id</p>
</td>
<td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036016755__p49957660">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.82%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036016755__p20038698">Request ID, which is unique</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row45587811"><td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036016755__p1625174">topic_count</p>
</td>
<td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036016755__p64530307">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="36.82%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036016755__p59572368">Number of topics in your account</p>
<div class="note" id="EN-US_TOPIC_0036016755__note48698383125"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0036016755__p452954191219">No matter what you have set for <strong id="EN-US_TOPIC_0036016755__b03617612455">offset</strong> and <strong id="EN-US_TOPIC_0036016755__b23713614452">limit</strong> in the request, this API always returns the total number of topics in your account.</p>
</div></div>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row8821459"><td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036016755__p43449544">topics</p>
</td>
<td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036016755__p199213945412">Array of <a href="#EN-US_TOPIC_0036016755__table10636317195533">Table 1</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="36.82%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036016755__p61114224">Topic structure array</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0036016755__table10636317195533"></a><a name="table10636317195533"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036016755__table10636317195533" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Topic structure</caption><thead align="left"><tr id="EN-US_TOPIC_0036016755__row28583391195533"><th align="left" class="cellrowborder" valign="top" width="29.69%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="EN-US_TOPIC_0036016755__p33553343195533"><strong id="EN-US_TOPIC_0036016755__b15946175092320">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.050000000000004%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="EN-US_TOPIC_0036016755__p33466243195533"><strong id="EN-US_TOPIC_0036016755__b1946170535">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="42.26%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="EN-US_TOPIC_0036016755__p26411156195533"><strong id="EN-US_TOPIC_0036016755__b2090916559234">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0036016755__row8508090195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0036016755__p18066721195533">topic_urn</p>
</td>
<td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0036016755__p54118259195533">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.26%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0036016755__p21502874195533">Resource identifier of a topic, which is unique</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row39230450195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0036016755__p23549883195533">name</p>
</td>
<td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0036016755__p28492405195533">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.26%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0036016755__p26183496195533">Name of the topic</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row28851380195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0036016755__p55260426195533">display_name</p>
</td>
<td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0036016755__p46909558195533">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.26%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0036016755__p41577821195533">Topic display name, which is presented as the name of the email sender in email messages</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row44134393195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0036016755__p18116055195533">push_policy</p>
</td>
<td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0036016755__p58114317195533">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="42.26%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0036016755__p9639236195533">Message push policy</p>
<ul id="EN-US_TOPIC_0036016755__ul10412105324519"><li id="EN-US_TOPIC_0036016755__li1412135354512"><strong id="EN-US_TOPIC_0036016755__b179312531221">0</strong>: Failed messages will be saved in message queues.</li><li id="EN-US_TOPIC_0036016755__li5521155511451"><strong id="EN-US_TOPIC_0036016755__b162877072614">1</strong>: Failed messages will be discarded.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0036016755__row41651747153414"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0036016755__p15786131535212">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0036016755__p878621517526">String</p>
</td>
<td class="cellrowborder" valign="top" width="42.26%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0036016755__p77871015125217">Enterprise project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0036016755__li59092488">Example response<pre class="screen" id="EN-US_TOPIC_0036016755__screen1678975319346">{
"request_id": "70bb40bef50e4a14b116a5a527fd7432",
"topic_count": 1,
"topics": [
{
"topic_urn": "urn:smn:regionId:8bad8a40e0f7462f8c1676e3f93a8183:test_topic_v2",
"display_name": "testtest",
"name": "test_topic_v1",
"push_policy": 0,
"enterprise_project_id" : "0"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0036016755__section44012677"><h4 class="sectiontitle">Returned Value</h4><p id="EN-US_TOPIC_0036016755__p22140377">See <a href="smn_api_63002.html">Returned Value</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0036016755__section73211020122511"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0036016755__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>