Last modified by Rayaan Ahmed on 2025/02/09 22:20

From version 12.1
edited by Admin User
on 2024/04/29 13:06
Change comment: There is no comment for this version
To version 13.1
edited by Rayaan Ahmed
on 2025/02/03 18:55
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +XWiki.rayaan
Content
... ... @@ -10139,7 +10139,7 @@
10139 10139  (% id="HCOMPONENT:SourceCodes" class="western" %)
10140 10140  === **COMPONENT: Source Codes** ===
10141 10141  
10142 -*
10142 +*
10143 10143  ** ===
10144 10144  
10145 10145  (% class="western" %)
... ... @@ -13632,7 +13632,7 @@
13632 13632  (% id="HCOMPONENT:Segments" class="western" %)
13633 13633  === **COMPONENT: Segments** ===
13634 13634  
13635 -*
13635 +*
13636 13636  ** ===
13637 13637  
13638 13638  (% class="western" %)
... ... @@ -14125,7 +14125,7 @@
14125 14125  (% id="HCOMPONENT:Leads" class="western" %)
14126 14126  === **COMPONENT: Leads** ===
14127 14127  
14128 -*
14128 +*
14129 14129  ** ===
14130 14130  
14131 14131  (% class="western" %)
... ... @@ -15302,3 +15302,85 @@
15302 15302  (% class="western" %)
15303 15303  If the page url already exists and it doesn't match with the one that is being sent then it will throw conflict error with the title in our system.
15304 15304  )))
15305 +
15306 +
15307 +**Example 1: How to use API  to unsubscribe user from package if you don't have a package ID or term ID**
15308 +
15309 +**~1. Get all packages using below API call**
15310 +
15311 +[[https:~~/~~/api.onecount.net/v2/products?limit=10000>>url:https://api.onecount.net/v2/products?limit=10000]]
15312 +\\This will give all the packages with all the resources attached to that package below is sample response.
15313 +
15314 +
15315 +[
15316 +
15317 + {
15318 +
15319 + "ProductId": 2374,
15320 +
15321 + "Title": "OptL-0- ENTECH EVENT-VSL Virtual Seminars",
15322 +
15323 + "Description": "",
15324 +
15325 + "ResourceIDs": [
15326 +
15327 + 16366,
15328 +
15329 + 16374,
15330 +
15331 + 16638,
15332 +
15333 + 16646,
15334 +
15335 + 17030,
15336 +
15337 + 17038,
15338 +
15339 + 17046,
15340 +
15341 + 17054
15342 +
15343 + ],
15344 +
15345 + "PrimaryFormID": [
15346 +
15347 + "251fc466-0f68-483d-afa6-1b05cb3ae9b0"
15348 +
15349 + ],
15350 +
15351 + "Terms": {
15352 +
15353 + "Id": 2462,
15354 +
15355 + "Name": "Active",
15356 +
15357 + "Description": "",
15358 +
15359 + "Duration": 1,
15360 +
15361 + "DurationUnit": "D",
15362 +
15363 + "Price": "0",
15364 +
15365 + "ProductId": 2374
15366 +
15367 + }
15368 +
15369 + }
15370 +
15371 +]
15372 +
15373 +
15374 +FYI : ResourceIDs are product ids
15375 +
15376 +Productid is package id
15377 +\\If your desired resource is in the package then use the product id and term id to unsubscribe user from that package
15378 +
15379 +**2. Use product id and term id  from the response above to unsubscribe user from the package**
15380 +\\Use this API and body to unsubscribe users
15381 +\\[[https:~~/~~/api.onecount.net/v2/transactions>>url:https://api.onecount.net/v2/transactions]]
15382 +\\**BODY:**
15383 +{"UserId": 126715990,"TermId":2462,"UserIP":"192.168.0.1" ,"SubscriptionType":"u" , "ProductId":2374 ,"ResourceId":0,"FormId": "","Source": 39,"ProductStatus": 2,"Amount":"0.00" ,"PaypalTransId":"" , "MediaFilePath":"" ,"Remarks": "USER UNSUBSCRIBED FROM API","BatchId":"1234" ,"Quantity": 1, "ExpireDate":"20260115" }
15384 +\\\\This will unsubscribe user from that package
15385 +
15386 +