forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: guoyanyan <guoyanyan3@huawei.com> Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
163 lines
12 KiB
HTML
163 lines
12 KiB
HTML
<a name="smn_api_51004"></a><a name="smn_api_51004"></a>
|
||
|
||
<h1 class="topictitle1">Querying Topics</h1>
|
||
<div id="body7204713"><div class="section" id="smn_api_51004__en-us_topic_0025373767-chtext"><h4 class="sectiontitle">Description</h4><ul id="smn_api_51004__ul33304380203733"><li id="smn_api_51004__li51147505203733">API name<p id="smn_api_51004__p38624841203741">ListTopics</p>
|
||
</li></ul>
|
||
<ul id="smn_api_51004__ul20998054203745"><li id="smn_api_51004__li46884910203750">Function<p id="smn_api_51004__p2178318594456">Query the topic list by page. The list is sorted by the topic creation time in descending order. If no topic has been created, an empty list is returned.</p>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_51004__section30715040"><h4 class="sectiontitle">URI</h4><ul id="smn_api_51004__ul25483595"><li id="smn_api_51004__li28025763">URI format<p id="smn_api_51004__p1715310221219">GET /v2/{project_id}/notifications/topics?offset={offset}&limit={limit}</p>
|
||
</li></ul>
|
||
<ul id="smn_api_51004__ul55494360"><li id="smn_api_51004__li29687198">Parameter description
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_51004__table65858198" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_51004__row16627584"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="smn_api_51004__p4657088"><strong id="smn_api_51004__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="smn_api_51004__p41679865"><strong id="smn_api_51004__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="smn_api_51004__p20625874"><strong id="smn_api_51004__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="smn_api_51004__p60083059"><strong id="smn_api_51004__b84235270619115">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_51004__row7485743"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_51004__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="smn_api_51004__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="smn_api_51004__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="smn_api_51004__p12240680154940">Project ID</p>
|
||
<p id="smn_api_51004__p22717550">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row52313669"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_51004__p9548790">offset</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="smn_api_51004__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="smn_api_51004__p37041500">int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="27.35%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="smn_api_51004__p146581828102110">Offset</p>
|
||
<p id="smn_api_51004__p21821344207">If the value is an integer greater than 0 but less than the number of resources, all resources after this offset will be queried. The default value is <strong id="smn_api_51004__b168815174914">0</strong>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row51489795"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_51004__p9923843">limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="smn_api_51004__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="smn_api_51004__p14739853">int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="27.35%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><ul id="smn_api_51004__ul38160342182720"><li id="smn_api_51004__li7898765182720">Number of resources returned on each page</li><li id="smn_api_51004__li35820204182720">Value range: 1–100<p id="smn_api_51004__p683218308526">Commonly used values are <strong id="smn_api_51004__b85981650205215">10</strong>, <strong id="smn_api_51004__b106551253205216">20</strong>, and <strong id="smn_api_51004__b11116125714526">50</strong>.</p>
|
||
<p id="smn_api_51004__p18225173316526">The default value is <strong id="smn_api_51004__b842352706165234">100</strong>.</p>
|
||
</li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_51004__section7999906"><h4 class="sectiontitle">Request</h4><div class="p" id="smn_api_51004__p29034848191242">Request example<pre class="screen" id="smn_api_51004__screen22083013104528">GET https://{SMN_Endpoint}/v2/{project_id}/notifications/topics?offset=0&limit=100</pre>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="smn_api_51004__section4890297"><h4 class="sectiontitle">Response</h4><ul id="smn_api_51004__ul46802360"><li id="smn_api_51004__li18568063">Parameter description
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_51004__table32894845" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_51004__row40748571"><th align="left" class="cellrowborder" valign="top" width="31.59%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="smn_api_51004__p12299945"><strong id="smn_api_51004__b1100369615">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="smn_api_51004__p56771492"><strong id="smn_api_51004__b1959114811">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="smn_api_51004__p35088115"><strong id="smn_api_51004__b1310872242">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_51004__row29721263"><td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__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="smn_api_51004__p20038698">Request ID, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row45587811"><td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__p64530307">int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="36.82%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_51004__p59572368">Number of topics in your account</p>
|
||
<div class="note" id="smn_api_51004__note48698383125"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="smn_api_51004__p452954191219">No matter what offset and limit values you have set in the request, this parameter always returns the total number of topics.</p>
|
||
</div></div>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row8821459"><td class="cellrowborder" valign="top" width="31.59%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__p29752153">Topic structure array</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="36.82%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_51004__p15409255121419">Topic details</p>
|
||
<p id="smn_api_51004__p61114224">See <a href="#smn_api_51004__table10636317195533">Table 1</a>.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="tablenoborder"><a name="smn_api_51004__table10636317195533"></a><a name="table10636317195533"></a><table cellpadding="4" cellspacing="0" summary="" id="smn_api_51004__table10636317195533" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Topic structure</caption><thead align="left"><tr id="smn_api_51004__row28583391195533"><th align="left" class="cellrowborder" valign="top" width="29.69%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="smn_api_51004__p33553343195533"><strong id="smn_api_51004__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="smn_api_51004__p33466243195533"><strong id="smn_api_51004__b144700883">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="smn_api_51004__p26411156195533"><strong id="smn_api_51004__b2090916559234">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_51004__row8508090195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__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="smn_api_51004__p21502874195533">Resource identifier of a topic, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row39230450195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__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="smn_api_51004__p26183496195533">Topic name</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row28851380195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__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="smn_api_51004__p41577821195533">Topic display name, which is presented as the name of the email sender in email messages</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_51004__row44134393195533"><td class="cellrowborder" valign="top" width="29.69%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_51004__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="smn_api_51004__p58114317195533">Int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="42.26%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_51004__p9639236195533">Message push policy</p>
|
||
<ul id="smn_api_51004__ul10412105324519"><li id="smn_api_51004__li1412135354512"><strong id="smn_api_51004__b179312531221">0</strong>: Failed messages will be saved in message queues.</li><li id="smn_api_51004__li5521155511451"><strong id="smn_api_51004__b162877072614">1</strong>: Failed messages will be discarded.</li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="smn_api_51004__li59092488">Response example<pre class="screen" id="smn_api_51004__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
|
||
}
|
||
]
|
||
}</pre>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_51004__section44012677"><h4 class="sectiontitle">Returned Value</h4><p id="smn_api_51004__p22140377">See section <a href="smn_api_63002.html">Returned Value</a>.</p>
|
||
</div>
|
||
<div class="section" id="smn_api_51004__section73211020122511"><h4 class="sectiontitle">Error Code</h4><p id="smn_api_51004__p9759142919265">See section <a href="smn_api_64000.html">Error Code</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>
|
||
|