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>
194 lines
16 KiB
HTML
194 lines
16 KiB
HTML
<a name="smn_api_52001"></a><a name="smn_api_52001"></a>
|
||
|
||
<h1 class="topictitle1">Querying Subscriptions</h1>
|
||
<div id="body19797588"><div class="section" id="smn_api_52001__section61847473"><h4 class="sectiontitle">Description</h4><ul id="smn_api_52001__ul33304380203733"><li id="smn_api_52001__li51147505203733">API name<p id="smn_api_52001__p38624841203741"><a name="smn_api_52001__li51147505203733"></a><a name="li51147505203733"></a>ListSubscriptions</p>
|
||
</li></ul>
|
||
<ul id="smn_api_52001__ul20998054203745"><li id="smn_api_52001__li46884910203750">Function<p id="smn_api_52001__p60100823"><a name="smn_api_52001__li46884910203750"></a><a name="li46884910203750"></a>Query the list of all subscriptions by page. The list is sorted by the subscription adding time in ascending order. When querying the subscription list by page, you can specify <strong id="smn_api_52001__b13399855162112">offset</strong> and <strong id="smn_api_52001__b23991655172117">limit</strong>. If no subscription has been added to the topic, an empty list is returned.</p>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_52001__section19756352"><h4 class="sectiontitle">URI</h4><ul id="smn_api_52001__ul36328474"><li id="smn_api_52001__li58520811">URI format<p id="smn_api_52001__p56925253"><a name="smn_api_52001__li58520811"></a><a name="li58520811"></a>GET /v2/{project_id}/notifications/subscriptions?offset={offset}&limit={limit}</p>
|
||
</li><li id="smn_api_52001__li2696442112564">Parameter description
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_52001__table47542785" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_52001__row44806966"><th align="left" class="cellrowborder" valign="top" width="21.002100210021002%" id="mcps1.3.2.2.2.1.1.5.1.1"><p id="smn_api_52001__p5485596"><strong id="smn_api_52001__b842352706191030">Parameter</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="20.022002200220022%" id="mcps1.3.2.2.2.1.1.5.1.2"><p id="smn_api_52001__p41680131"><strong id="smn_api_52001__b593421527191713">Mandatory</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="21.002100210021002%" id="mcps1.3.2.2.2.1.1.5.1.3"><p id="smn_api_52001__p20647442"><strong id="smn_api_52001__b84235270619112">Type</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="37.973797379737974%" id="mcps1.3.2.2.2.1.1.5.1.4"><p id="smn_api_52001__p61830130"><strong id="smn_api_52001__b84235270619115">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_52001__row61513540"><td class="cellrowborder" valign="top" width="21.002100210021002%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_52001__p16540805">project_id</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.022002200220022%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_52001__p64736823">Yes</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="21.002100210021002%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_52001__p9191297">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="37.973797379737974%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_52001__p5734644015513">Project ID</p>
|
||
<p id="smn_api_52001__p6297612">See <a href="smn_api_66000.html">Obtaining a Project ID</a>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52001__row27556864"><td class="cellrowborder" valign="top" width="21.002100210021002%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_52001__p17513507">offset</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.022002200220022%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_52001__p4777719172219">No</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="21.002100210021002%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_52001__p15748167">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="37.973797379737974%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><p id="smn_api_52001__p146581828102110">Offset</p>
|
||
<p id="smn_api_52001__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="smn_api_52001__b59611621827">0</strong>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52001__row53117702"><td class="cellrowborder" valign="top" width="21.002100210021002%" headers="mcps1.3.2.2.2.1.1.5.1.1 "><p id="smn_api_52001__p7566645">limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="20.022002200220022%" headers="mcps1.3.2.2.2.1.1.5.1.2 "><p id="smn_api_52001__p12416120172223">No</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="21.002100210021002%" headers="mcps1.3.2.2.2.1.1.5.1.3 "><p id="smn_api_52001__p51313205">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="37.973797379737974%" headers="mcps1.3.2.2.2.1.1.5.1.4 "><ul id="smn_api_52001__ul38160342182720"><li id="smn_api_52001__li7898765182720">Value range: 1–100<p id="smn_api_52001__p3980022182720"><a name="smn_api_52001__li7898765182720"></a><a name="li7898765182720"></a>Commonly used numbers are <strong id="smn_api_52001__b17124217134617">10</strong>, <strong id="smn_api_52001__b169771314154610">20</strong>, and <strong id="smn_api_52001__b78111511194612">50</strong>.</p>
|
||
</li><li id="smn_api_52001__li35820204182720">Number of resources returned on each page</li></ul>
|
||
<p id="smn_api_52001__p5184153012911">The default number is <strong id="smn_api_52001__b109171820114612">100</strong>.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="smn_api_52001__section43589445"><h4 class="sectiontitle">Request</h4><div class="p" id="smn_api_52001__p49570611191843">Example request<pre class="screen" id="smn_api_52001__screen4781279510485">GET https://{SMN_Endpoint}/v2/{project_id}/notifications/subscriptions?offset=0&limit=2</pre>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="smn_api_52001__section56760689"><h4 class="sectiontitle">Response</h4><ul id="smn_api_52001__ul1762431"><li id="smn_api_52001__li15861880">Parameter description
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="smn_api_52001__table8539194" frame="border" border="1" rules="all"><thead align="left"><tr id="smn_api_52001__row46855021"><th align="left" class="cellrowborder" valign="top" width="29.95299529952995%" id="mcps1.3.4.2.1.1.1.4.1.1"><p id="smn_api_52001__p37160390"><strong id="smn_api_52001__b441728220">Parameter</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="29.95299529952995%" id="mcps1.3.4.2.1.1.1.4.1.2"><p id="smn_api_52001__p57201619"><strong id="smn_api_52001__b1199087601">Type</strong></p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="40.09400940094009%" id="mcps1.3.4.2.1.1.1.4.1.3"><p id="smn_api_52001__p2819581"><strong id="smn_api_52001__b919952445">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="smn_api_52001__row44335814"><td class="cellrowborder" valign="top" width="29.95299529952995%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_52001__p34431157">request_id</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="29.95299529952995%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_52001__p37460321">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="40.09400940094009%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_52001__p14387121">Request ID, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52001__row19228540"><td class="cellrowborder" valign="top" width="29.95299529952995%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_52001__p14007894">subscription_count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="29.95299529952995%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_52001__p60897649">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="40.09400940094009%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_52001__p33762549">Number of subscriptions</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="smn_api_52001__row51054032"><td class="cellrowborder" valign="top" width="29.95299529952995%" headers="mcps1.3.4.2.1.1.1.4.1.1 "><p id="smn_api_52001__p41735936">subscriptions</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="29.95299529952995%" headers="mcps1.3.4.2.1.1.1.4.1.2 "><p id="smn_api_52001__p5779341598">Array of <a href="#smn_api_52001__table43425256195712">Table 1</a> objects</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="40.09400940094009%" headers="mcps1.3.4.2.1.1.1.4.1.3 "><p id="smn_api_52001__p1779641094">Subscription structure</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="tablenoborder"><a name="smn_api_52001__table43425256195712"></a><a name="table43425256195712"></a><table cellpadding="4" cellspacing="0" summary="" id="smn_api_52001__table43425256195712" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Subscription structure</caption><thead align="left"><tr id="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_52001__p21249193195712"><strong id="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_52001__p43463090195712"><strong id="smn_api_52001__b918512811">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_52001__p30849371195712"><strong id="smn_api_52001__b11761269480">Description</strong></p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="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_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_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_52001__p3067911195712">Resource identifier of a topic, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="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_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_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_52001__p65990551195712">Subscription protocol (Different protocols indicate different types of endpoints to receive messages.)</p>
|
||
<p id="smn_api_52001__p15571735514">The following protocols are supported:</p>
|
||
<ul id="smn_api_52001__ul1715273514576"><li id="smn_api_52001__li1915283525718"><strong id="smn_api_52001__b65901133114410">email</strong>: The endpoints are email address.</li><li id="smn_api_52001__li031203718574"><strong id="smn_api_52001__b99571741008">sms</strong>: The endpoints are phone numbers.</li><li id="smn_api_52001__li1682010496573"><strong id="smn_api_52001__b1099011287223">http</strong> and <strong id="smn_api_52001__b577715331224">https</strong>: The endpoints are URLs.</li></ul>
|
||
</td>
|
||
</tr>
|
||
<tr id="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_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_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_52001__p31776236195712">Resource identifier of a subscription, which is unique</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="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_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_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_52001__p15092119195712">Project ID of the topic creator</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="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_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_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_52001__p29956849195712">Message receiving endpoint</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="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_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_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_52001__p19266652195712">Remarks</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="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_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_52001__p56491591195712">Integer</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_52001__p12416128195712">Subscription status</p>
|
||
<ul id="smn_api_52001__ul1357151620117"><li id="smn_api_52001__li1935716167111"><strong id="smn_api_52001__b1964943612113">0</strong>: unconfirmed</li><li id="smn_api_52001__li34351819516"><strong id="smn_api_52001__b1944317489116">1</strong>: confirmed</li><li id="smn_api_52001__li1382111211311"><strong id="smn_api_52001__b15634230216">3</strong>: canceled</li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="smn_api_52001__li65077851">Example response<pre class="screen" id="smn_api_52001__screen35656321192225">{
|
||
"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": "xxxxxxxxxxx",
|
||
"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_52001__section41084157"><h4 class="sectiontitle">Returned Value</h4><p id="smn_api_52001__p58343698">See <a href="smn_api_63002.html">Returned Value</a>.</p>
|
||
</div>
|
||
<div class="section" id="smn_api_52001__section73211020122511"><h4 class="sectiontitle">Error Codes</h4><p id="smn_api_52001__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_52000.html">Subscription Operations</a></div>
|
||
</div>
|
||
</div>
|
||
|