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>
204 lines
17 KiB
HTML
204 lines
17 KiB
HTML
<a name="smn_api_52002"></a><a name="smn_api_52002"></a>
|
||
|
||
<h1 class="topictitle1">Querying Subscriptions of a Specified Topic</h1>
|
||
<div id="body37742617"><div class="section" id="smn_api_52002__en-us_topic_0025373770"><h4 class="sectiontitle">Description</h4><ul id="smn_api_52002__ul33304380203733"><li id="smn_api_52002__li51147505203733">API name<p id="smn_api_52002__p38624841203741">ListSubscriptionsByTopic</p>
|
||
</li></ul>
|
||
<ul id="smn_api_52002__ul20998054203745"><li id="smn_api_52002__li46884910203750">Function<p id="smn_api_52002__p37253141">Query the list of subscriptions of a specified topic by page. The list is sorted by the subscription adding time in ascending order. If no subscription has been added to the topic, an empty list is returned.</p>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_52002__section37356392"><h4 class="sectiontitle">URI</h4><ul id="smn_api_52002__ul64714441"><li id="smn_api_52002__li45559064">URI format<p id="smn_api_52002__p7378398">GET /v2/{project_id}/notifications/topics/{topic_urn}/subscriptions?offset={offset}&limit={limit}</p>
|
||
</li></ul>
|
||
<ul id="smn_api_52002__ul66405588"><li id="smn_api_52002__li60779388">Parameter description
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_52002__table10143581" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_52002__row8289053"><th align="left" class="cellrowborder" valign="top" width="24.709999999999997%" id="mcps1.3.2.3.1.1.1.5.1.1"><p id="smn_api_52002__p324668"><strong id="smn_api_52002__b842352706191030">Parameter</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="20.06%" id="mcps1.3.2.3.1.1.1.5.1.2"><p id="smn_api_52002__p26298136"><strong id="smn_api_52002__b593421527191713">Mandatory</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="19.61%" id="mcps1.3.2.3.1.1.1.5.1.3"><p id="smn_api_52002__p49774232"><strong id="smn_api_52002__b84235270619112">Type</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="35.620000000000005%" id="mcps1.3.2.3.1.1.1.5.1.4"><p id="smn_api_52002__p5180964"><strong id="smn_api_52002__b84235270619115">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_52002__row35224963"><td class="cellrowborder" valign="top" width="24.709999999999997%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_52002__p34649765">project_id</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.06%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="smn_api_52002__p55167604">Yes</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="19.61%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="smn_api_52002__p39390935">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="35.620000000000005%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="smn_api_52002__p7542769155117">Project ID</p>
|
||
<p id="smn_api_52002__p36549175">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__row2129750"><td class="cellrowborder" valign="top" width="24.709999999999997%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_52002__p38292076">topic_urn</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.06%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="smn_api_52002__p14650458">Yes</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="19.61%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="smn_api_52002__p45836489">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="35.620000000000005%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="smn_api_52002__p21768161">Unique resource ID of a topic. You can obtain it according to <a href="smn_api_51004.html">Querying Topics</a>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__row31297682"><td class="cellrowborder" valign="top" width="24.709999999999997%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_52002__p52084342">offset</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.06%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="smn_api_52002__p37545213172528">No</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="19.61%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="smn_api_52002__p7035667">int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="35.620000000000005%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><p id="smn_api_52002__p146581828102110">Offset</p>
|
||
<p id="smn_api_52002__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_52002__b11811133314711">0</strong>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__row45251091"><td class="cellrowborder" valign="top" width="24.709999999999997%" headers="mcps1.3.2.3.1.1.1.5.1.1 "><p id="smn_api_52002__p41459726">limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.06%" headers="mcps1.3.2.3.1.1.1.5.1.2 "><p id="smn_api_52002__p6679585172531">No</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="19.61%" headers="mcps1.3.2.3.1.1.1.5.1.3 "><p id="smn_api_52002__p25040094">int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="35.620000000000005%" headers="mcps1.3.2.3.1.1.1.5.1.4 "><ul id="smn_api_52002__ul38160342182720"><li id="smn_api_52002__li35820204182720">Number of resources returned on each page</li><li id="smn_api_52002__li7898765182720">Value range: 1–100<p id="smn_api_52002__p3980022182720">Commonly used values are <strong id="smn_api_52002__b1988313383187">10</strong>, <strong id="smn_api_52002__b13884138181811">20</strong>, and <strong id="smn_api_52002__b28859388189">50</strong>.</p>
|
||
<p id="smn_api_52002__p1134873382116">The default value is <strong id="smn_api_52002__b82991142181817">100</strong>.</p>
|
||
</li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_52002__section663215"><h4 class="sectiontitle">Request</h4><div class="p" id="smn_api_52002__p4632447612049">Example request<pre class="screen" id="smn_api_52002__screen10727247104927">GET https://{SMN_Endpoint}/v2/{project_id}/notifications/topics/urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1/subscriptions?offset=0&limit=100 </pre>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="smn_api_52002__section5968939"><h4 class="sectiontitle">Response</h4><ul id="smn_api_52002__ul46769243"><li id="smn_api_52002__li18270010">Parameter description
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_52002__table30212363" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_52002__row20364417"><th align="left" class="cellrowborder" valign="top" width="27.53724627537246%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="smn_api_52002__p38905106"><strong id="smn_api_52002__b842352706191030_1">Parameter</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="38.50614938506149%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="smn_api_52002__p64305920"><strong id="smn_api_52002__b84235270619112_1">Type</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="33.95660433956604%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="smn_api_52002__p41397042"><strong id="smn_api_52002__b84235270619115_1">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_52002__row16425092"><td class="cellrowborder" valign="top" width="27.53724627537246%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_52002__p55364084">request_id</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="38.50614938506149%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_52002__p55305800">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="33.95660433956604%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_52002__p50584809">Request ID, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__row33559471"><td class="cellrowborder" valign="top" width="27.53724627537246%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_52002__p33962670">subscription_count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="38.50614938506149%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_52002__p66621782">int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="33.95660433956604%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_52002__p27655246">Number of subscriptions</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__row28015283"><td class="cellrowborder" valign="top" width="27.53724627537246%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_52002__p54645451">subscriptions</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="38.50614938506149%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_52002__p64205424">Subscription structure array</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="33.95660433956604%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_52002__p33256841">For details, see <a href="#smn_api_52002__table62621618105717">Table 1</a>.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="tablenoborder"><a name="smn_api_52002__table62621618105717"></a><a name="table62621618105717"></a><table cellpadding="4" cellspacing="0" summary="" id="smn_api_52002__table62621618105717" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Subscription structure</caption><thead align="left"><tr id="smn_api_52002__smn_api_52001_row57429145195712"><th align="left" class="cellrowborder" valign="top" width="28.6971302869713%" id="mcps1.3.4.2.1.2.2.4.1.1"><p id="smn_api_52002__smn_api_52001_p21249193195712"><strong id="smn_api_52002__smn_api_52001_b18916324810">Parameter</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="31.786821317868213%" id="mcps1.3.4.2.1.2.2.4.1.2"><p id="smn_api_52002__smn_api_52001_p43463090195712"><strong id="smn_api_52002__smn_api_52001_b84235270619112">Type</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="39.51604839516049%" id="mcps1.3.4.2.1.2.2.4.1.3"><p id="smn_api_52002__smn_api_52001_p30849371195712"><strong id="smn_api_52002__smn_api_52001_b11761269480">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_52002__smn_api_52001_row2389422195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p59325480195712">topic_urn</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p40634595195712">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p3067911195712">Resource identifier of a topic, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__smn_api_52001_row21914642195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p30255586195712">protocol</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p34783382195712">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p65990551195712">Subscription protocol (Different protocols indicate different types of endpoints to receive messages.)</p>
|
||
<p id="smn_api_52002__smn_api_52001_p15571735514">Currently, the following protocols are supported:</p>
|
||
<ul id="smn_api_52002__smn_api_52001_ul1715273514576"><li id="smn_api_52002__smn_api_52001_li1915283525718"><strong id="smn_api_52002__smn_api_52001_b65901133114410">email</strong>: The endpoints are email address.</li><li id="smn_api_52002__smn_api_52001_li031203718574"><strong id="smn_api_52002__smn_api_52001_b99571741008">sms</strong>: The endpoints are phone numbers.</li><li id="smn_api_52002__smn_api_52001_li1682010496573"><strong id="smn_api_52002__smn_api_52001_b1099011287223">http</strong> and <strong id="smn_api_52002__smn_api_52001_b577715331224">https</strong>: The endpoints are URLs.</li></ul>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__smn_api_52001_row57165101195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p66970508195712">subscription_urn</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p55902100195712">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p31776236195712">Resource identifier of a subscription, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__smn_api_52001_row12318113195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p58243097195712">owner</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p20070430195712">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p15092119195712">Project ID of the topic creator</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__smn_api_52001_row63410262195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p35957569195712">endpoint</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p26881981195712">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p29956849195712">Message receiving endpoint</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__smn_api_52001_row28162748195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p66590149195712">remark</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p25092994195712">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p19266652195712">Remarks</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52002__smn_api_52001_row19637006195712"><td class="cellrowborder" valign="top" width="28.6971302869713%" headers="mcps1.3.4.2.1.2.2.4.1.1 "><p id="smn_api_52002__smn_api_52001_p47093678195712">status</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="31.786821317868213%" headers="mcps1.3.4.2.1.2.2.4.1.2 "><p id="smn_api_52002__smn_api_52001_p56491591195712">Int</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="39.51604839516049%" headers="mcps1.3.4.2.1.2.2.4.1.3 "><p id="smn_api_52002__smn_api_52001_p12416128195712">Subscription status</p>
|
||
<ul id="smn_api_52002__smn_api_52001_ul1357151620117"><li id="smn_api_52002__smn_api_52001_li1935716167111"><strong id="smn_api_52002__smn_api_52001_b1964943612113">0</strong>: unconfirmed</li><li id="smn_api_52002__smn_api_52001_li34351819516"><strong id="smn_api_52002__smn_api_52001_b1944317489116">1</strong>: confirmed</li><li id="smn_api_52002__smn_api_52001_li1382111211311"><strong id="smn_api_52002__smn_api_52001_b15634230216">3</strong>: canceled</li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="smn_api_52002__li17937528">Example response<pre class="screen" id="smn_api_52002__screen38621224192324">{
|
||
"request_id": "4650b14bf221492fb819c231d167e6fe",
|
||
"subscription_count": 2,
|
||
"subscriptions": [
|
||
{
|
||
"topic_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1",
|
||
"protocol": "sms",
|
||
"subscription_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1:2e778e84408e44058e6cbc6d3c377837",
|
||
"owner": "762bdb3251034f268af0e395c53ea09b",
|
||
"endpoint": "xxxxxxxxxx",
|
||
"remark": "",
|
||
"status": 0
|
||
},
|
||
{
|
||
"topic_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1",
|
||
"protocol": "email",
|
||
"subscription_urn": "urn:smn:regionId:762bdb3251034f268af0e395c53ea09b:test_topic_v1:a2d52a9f5c3b47f48c3fafb177a58796",
|
||
"owner": "762bdb3251034f268af0e395c53ea09b",
|
||
"endpoint": "xx@xx.com",
|
||
"remark": "",
|
||
"status": 0
|
||
}
|
||
]
|
||
}</pre>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_52002__section53720453"><h4 class="sectiontitle">Returned Value</h4><p id="smn_api_52002__p17474517">See section <a href="smn_api_63002.html">Returned Value</a>.</p>
|
||
</div>
|
||
<div class="section" id="smn_api_52002__section73211020122511"><h4 class="sectiontitle">Error Code</h4><p id="smn_api_52002__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_52000.html">Subscription Operations</a></div>
|
||
</div>
|
||
</div>
|
||
|