Changes for page ONEcount API Documentation
Last modified by Rayaan Ahmed on 2025/02/09 22:20
From version 14.1
edited by Rayaan Ahmed
on 2025/02/09 21:08
on 2025/02/09 21:08
Change comment:
There is no comment for this version
To version 15.1
edited by Rayaan Ahmed
on 2025/02/09 22:20
on 2025/02/09 22:20
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -10167,7 +10167,7 @@ 10167 10167 10168 10168 (% style="color:#6b6b6b" %)Request 10169 10169 10170 -{{code language="php" title="G etspecificResourceRequest"}}10170 +{{code language="php" title="GET users, resource id and request date based on subscription type and start date"}} 10171 10171 <?php 10172 10172 10173 10173 $curl = curl_init(); ... ... @@ -10195,7 +10195,7 @@ 10195 10195 10196 10196 (% style="color:#6b6b6b" %)Response 200 OK 10197 10197 10198 -{{code language="yml" title="G etspecificResourceResponse"}}10198 +{{code language="yml" title="GET users, resource id and request date based on subscription type and start date"}} 10199 10199 { 10200 10200 "result": { 10201 10201 "success": "1", ... ... @@ -10229,7 +10229,7 @@ 10229 10229 (% id="HCOMPONENT:SourceCodes" class="western" %) 10230 10230 === **COMPONENT: Source Codes** === 10231 10231 10232 -* 10232 +* 10233 10233 ** === 10234 10234 10235 10235 (% class="western" %) ... ... @@ -13722,7 +13722,7 @@ 13722 13722 (% id="HCOMPONENT:Segments" class="western" %) 13723 13723 === **COMPONENT: Segments** === 13724 13724 13725 -* 13725 +* 13726 13726 ** === 13727 13727 13728 13728 (% class="western" %) ... ... @@ -14215,7 +14215,7 @@ 14215 14215 (% id="HCOMPONENT:Leads" class="western" %) 14216 14216 === **COMPONENT: Leads** === 14217 14217 14218 -* 14218 +* 14219 14219 ** === 14220 14220 14221 14221 (% class="western" %) ... ... @@ -15393,7 +15393,7 @@ 15393 15393 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. 15394 15394 ))) 15395 15395 15396 -**Example 1: How to use API to unsubscribe userfrom package ifyoudon'thave a packageID or term ID**15396 +**Example 1: How to use API to get users who unsubscribed to resources in past 1 day and unsubscribe them to a package** 15397 15397 15398 15398 **~1. Get all packages using below API call** 15399 15399 ... ... @@ -15465,11 +15465,65 @@ 15465 15465 Productid is package id 15466 15466 \\If your desired resource is in the package then use the product id and term id to unsubscribe user from that package 15467 15467 15468 -**2. Use product id and term id from the response above to unsubscribe user from the package** 15468 +**2. Get all the users who unsubscribed to resources in past 1 day** 15469 + 15470 +use below API to get all user who unsubscribed to resources in past 1 day 15471 + 15472 +[[http:~~/~~/api.onecount.net/v2/resources/analytics?type=u&start_date=20250>>url:http://api.onecount.net/v2/resources/analytics?type=u&start_date=20250110]]209 15473 + 15474 +Below is the sample response : 15475 + 15476 +{ 15477 + 15478 +"result": { 15479 + 15480 + "success": "1", 15481 + 15482 + "error": { 15483 + 15484 + "code": "", 15485 + 15486 + "message": "" 15487 + 15488 + } 15489 + 15490 + }, 15491 + 15492 +"Resources Users": [ 15493 + 15494 +{ 15495 + 15496 +"resource_uid": "11462", 15497 + 15498 +"ocid": 74204991, 15499 + 15500 +"request_date": 20250118 15501 + 15502 +}, 15503 + 15504 +{ 15505 + 15506 +"resource_uid": "11462", 15507 + 15508 +"ocid": 121746390, 15509 + 15510 +"request_date": 20250118 15511 + 15512 +} 15513 + 15514 +] 15515 + 15516 +} 15517 + 15518 +FYI: 15519 +ocid = userid 15520 + 15521 + 15522 +**3. Use user, product id and term id from the response above to unsubscribe user from the package** 15469 15469 \\Use this API and body to unsubscribe users 15470 15470 \\[[https:~~/~~/api.onecount.net/v2/transactions>>url:https://api.onecount.net/v2/transactions]] 15471 15471 \\**BODY:** 15472 15472 {"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" } 15473 -\\ \\This will unsubscribe user from that package15527 +\\This will unsubscribe user from that package 15474 15474 15475 15475