Changes for page ONEcount API Documentation
Last modified by Rayaan Ahmed on 2025/02/09 22:20
To version 14.1
edited by Rayaan Ahmed
on 2025/02/09 22:08
on 2025/02/09 22:08
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -330,10 +330,6 @@ 330 330 331 331 ---- 332 332 333 -{{panel bgColor="#D3D3D3" width="100%"}} 334 -(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users 335 -{{/panel}} 336 - 337 337 === (% class="core-title" style="color:#212121" %)Request Headers(%%) === 338 338 339 339 ---- ... ... @@ -868,12 +868,6 @@ 868 868 869 869 ---- 870 870 871 -{{panel bgColor="#D3D3D3" width="100%"}} 872 - (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users/(% style="color:#212121" %)~{~{OCID}} 873 -{{/panel}} 874 - 875 -=== (% class="core-title" style="color:#212121" %)Request Headers(%%) === 876 - 877 877 ---- 878 878 879 879 (% class="Text__TextContainer-sc-1kqigik-0 cEvDCP iauueY item-key sc-fznXWL" style="color:#212121" %)Appkey (% class="Text__TextContainer-sc-1kqigik-0 iYynAw" style="color:#212121" %)~{~{ONECOUNT API KEY}} ... ... @@ -966,10 +966,6 @@ 966 966 967 967 ---- 968 968 969 -{{panel bgColor="#D3D3D3" width="100%"}} 970 - (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users(% class="nolink" style="color:#212121" %)/login 971 -{{/panel}} 972 - 973 973 === (% class="core-title" style="color:#212121" %)Request Headers(%%) === 974 974 975 975 ---- ... ... @@ -1040,10 +1040,6 @@ 1040 1040 1041 1041 ---- 1042 1042 1043 -{{panel bgColor="#D3D3D3" width="100%"}} 1044 -(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users(% class="nolink" style="color:#212121" %)/lookup?2=user_242_6298&return=1,2,3,4 1045 -{{/panel}} 1046 - 1047 1047 === (% class="core-title" style="color:#212121" %)Request Headers(%%) === 1048 1048 1049 1049 ---- ... ... @@ -1120,10 +1120,6 @@ 1120 1120 1121 1121 ---- 1122 1122 1123 -{{panel bgColor="#D3D3D3" width="100%"}} 1124 -(% class="nolink nolink" %)https:~/~/api.onecount.net/v2(% class="nolink" style="color:#212121" %)/users/~{~{OCID}}/partners/~{~{Partner id}} 1125 -{{/panel}} 1126 - 1127 1127 === (% class="core-title" style="color:#212121" %)Request Headers(%%) === 1128 1128 1129 1129 ---- ... ... @@ -1135,11 +1135,7 @@ 1135 1135 1136 1136 ---- 1137 1137 1138 -{{panel bgColor="#D3D3D3" width="100%"}} 1139 -(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users 1140 -{{/panel}} 1141 1141 1142 - 1143 1143 (% class="western" %) 1144 1144 **POST method should be used to create users.** 1145 1145 ... ... @@ -1308,11 +1308,7 @@ 1308 1308 1309 1309 ---- 1310 1310 1311 -{{panel bgColor="#D3D3D3" width="100%"}} 1312 - (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users/~{~{OCID(% class="nolink" %)}} 1313 -{{/panel}} 1314 1314 1315 - 1316 1316 (% class="western" %) 1317 1317 **PUT method should be used to update users.** 1318 1318 ... ... @@ -10165,11 +10165,101 @@ 10165 10165 } 10166 10166 {{/code}} 10167 10167 10138 +(% id="HGETspecificResource" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 10139 +== (% class="imuBmi sc-fzoaKM" id="cke_bm_37074S" style="color:#007f31; display:none" %) (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET(% class="imuBmi sc-fzoaKM" style="color:#212121" %) users, resource id and request date based on subscription type and start date(%%) == 10168 10168 10141 +---- 10142 + 10143 + 10144 +This API will pull all the users, resource id and request date based on subscription type and start date. There are 3 types of subscription type (n, r, u) where 10145 + 10146 +n = New subscription 10147 + 10148 +r = Renew subscription 10149 + 10150 +u = unsubscribe 10151 + 10152 +start date is used to pull users who has subscription activity from the start date to current date(todays date) you can go only past 30days as a start date. 10153 + 10154 +{{panel bgColor="#D3D3D3" width="100%"}} 10155 + (% class="nolink" %)https:~/~/api.onecount.net/v2(% style="color:#212121" %)/resources(%%)/analytics?type=~{~{Subscription Type}}&start_date=~{~{Start Date}} 10156 +{{/panel}} 10157 + 10158 +=== (% class="core-title" style="color:#212121" %)Request Headers(%%) === 10159 + 10160 +---- 10161 + 10162 +(% class="Text__TextContainer-sc-1kqigik-0 cEvDCP iauueY item-key sc-fznXWL" style="color:#212121" %)Appkey (% class="Text__TextContainer-sc-1kqigik-0 iYynAw" style="color:#212121" %)~{~{ONECOUNT API KEY}} 10163 + 10164 +==== Example ==== 10165 + 10166 +---- 10167 + 10168 +(% style="color:#6b6b6b" %)Request 10169 + 10170 +{{code language="php" title="Get specific Resource Request"}} 10171 + <?php 10172 + 10173 +$curl = curl_init(); 10174 + 10175 +curl_setopt_array($curl, array( 10176 + CURLOPT_URL => ' https://api.onecount.net/v2/resources/analytics?type={{Subscription Type}}&start_date={{Start Date}}', 10177 + CURLOPT_RETURNTRANSFER => true, 10178 + CURLOPT_ENCODING => '', 10179 + CURLOPT_MAXREDIRS => 10, 10180 + CURLOPT_TIMEOUT => 0, 10181 + CURLOPT_FOLLOWLOCATION => true, 10182 + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 10183 + CURLOPT_CUSTOMREQUEST => 'GET', 10184 + CURLOPT_HTTPHEADER => array( 10185 + 'Appkey: {{ONECOUNT API KEY}}' 10186 + ), 10187 +)); 10188 + 10189 +$response = curl_exec($curl); 10190 + 10191 +curl_close($curl); 10192 +echo $response; 10193 +{{/code}} 10194 + 10195 + 10196 +(% style="color:#6b6b6b" %)Response 200 OK 10197 + 10198 +{{code language="yml" title="Get specific Resource Response"}} 10199 + { 10200 + "result": { 10201 + "success": "1", 10202 + "error": { 10203 + "code": "", 10204 + "message": "" 10205 + } 10206 + }, 10207 + "Resources": [ 10208 + "Resources Users": [ 10209 + { 10210 + "resource_uid": "11462", 10211 + "ocid": 74204991, 10212 + "request_date": 20250118 10213 + }, 10214 + { 10215 + "resource_uid": "11462", 10216 + "ocid": 121746390, 10217 + "request_date": 20250118 10218 + }, 10219 + { 10220 + "resource_uid": "11462", 10221 + "ocid": 45412583, 10222 + "request_date": 20250118 10223 + } 10224 + ] 10225 +} 10226 +{{/code}} 10227 + 10228 + 10169 10169 (% id="HCOMPONENT:SourceCodes" class="western" %) 10170 10170 === **COMPONENT: Source Codes** === 10171 10171 10172 -* 10232 +* 10173 10173 ** === 10174 10174 10175 10175 (% class="western" %) ... ... @@ -12895,7 +12895,12 @@ 12895 12895 (% class="western" %) 12896 12896 NOTE: While updating a select and checkbox type question you need to pass complete set of Choices for that question including the one which are already existing. If not the choices will be overwritten from the choices from the body. 12897 12897 ))) 12898 -|(% style="text-align:left; vertical-align:top" %)POST|(% style="text-align:left; vertical-align:top" %) |(% style="text-align:left; vertical-align:top" %) 12958 +|(% style="text-align:left; vertical-align:top" %)POST|(% style="text-align:left; vertical-align:top" %)/engagements/metric/<engagement id>|(% style="text-align:left; vertical-align:top" %)((( 12959 +Add options to specific metric in an engagement without passing all options and overriding existing options. 12960 + 12961 +Parameters required to update the engagement needs to be sent as post data in JSON format. 12962 +\\This API is used to add options only for select and checkbox metrics. 12963 +))) 12899 12899 |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 12900 12900 ((( 12901 12901 (% class="western" %) ... ... @@ -13372,6 +13372,149 @@ 13372 13372 {{/code}} 13373 13373 13374 13374 13440 +(% id="HPUTUpdateEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 13441 +== (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" id="cke_bm_7146126S" style="color:#0053b8; display:none" %) (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#ad7a03" %)POST(% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#0053b8" %) (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)Add options to metric(%%) == 13442 + 13443 +---- 13444 + 13445 +{{panel bgColor="#D3D3D3" width="100%"}} 13446 + (% class="nolink" %)https:~/~/api.onecount.net/v2(%%)/engagements/metric/(% style="color:#212121" %)~{~{Engagement Id}} 13447 +{{/panel}} 13448 + 13449 +=== (% class="core-title" style="color:#212121" %)Request Headers(%%) === 13450 + 13451 +---- 13452 + 13453 +(% class="Text__TextContainer-sc-1kqigik-0 cEvDCP iauueY item-key sc-fznXWL" style="color:#212121" %)Appkey (% class="Text__TextContainer-sc-1kqigik-0 iYynAw" style="color:#212121" %)~{~{ONECOUNT API KEY}} 13454 + 13455 +=== (% style="color:#212121" %)Body (% style="color:#6b6b6b" %)raw (json)(%%) === 13456 + 13457 +---- 13458 + 13459 +{{code language="yml" title="Body"}} 13460 +{"Metrics":[ 13461 + {"Attendance Status":[{"text":"checks","value":"checks"},{"text":"c","value":"c"}]}, 13462 + {"lagacy status":[{"text":"c","value":"c"}]} 13463 + ]} 13464 +{{/code}} 13465 + 13466 +==== Example ==== 13467 + 13468 +---- 13469 + 13470 +(% style="color:#6b6b6b" %)Request 13471 + 13472 +{{code language="php" title="(% class=~"documentation-core-item-request-name jbmEtY sc-fzomuh~" style=~"color:#212121~" %)Add options to metric"}} 13473 + <?php 13474 + 13475 +$curl = curl_init(); 13476 + 13477 +curl_setopt_array($curl, array( 13478 + CURLOPT_URL => 'https://api.onecount.net/v2/engagements/metric/{{Engagement Id}}', 13479 + CURLOPT_RETURNTRANSFER => true, 13480 + CURLOPT_ENCODING => '', 13481 + CURLOPT_MAXREDIRS => 10, 13482 + CURLOPT_TIMEOUT => 0, 13483 + CURLOPT_FOLLOWLOCATION => true, 13484 + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 13485 + CURLOPT_CUSTOMREQUEST => 'PUT', 13486 + CURLOPT_POSTFIELDS =>'{"Metrics":[ 13487 + {"Attendance Status":[{"text":"checks","value":"checks"},{"text":"c","value":"c"}]}, 13488 + {"lagacy status":[{"text":"c","value":"c"}]} 13489 + ]}', 13490 + CURLOPT_HTTPHEADER => array( 13491 + 'Appkey: {{ONECOUNT API KEY}}', 13492 + 'Content-Type: application/json' 13493 + ), 13494 +)); 13495 + 13496 +$response = curl_exec($curl); 13497 + 13498 +curl_close($curl); 13499 +echo $response; 13500 + 13501 +{{/code}} 13502 + 13503 + 13504 +(% style="color:#6b6b6b" %)Response 200 OK 13505 + 13506 +{{code language="yml" title="(% class=~"documentation-core-item-request-name jbmEtY sc-fzomuh~" style=~"color:#212121~" %)Add options to metric"}} 13507 +{ 13508 + "result": { 13509 + "success": "1", 13510 + "error": { 13511 + "code": "", 13512 + "message": "" 13513 + } 13514 + }, 13515 + "Engagements": [ 13516 + { 13517 + "Id": "e0e816ec-77ba-4db1-bfc0-22d340337357", 13518 + "Name": "Test engagement 3", 13519 + "Metrics": [ 13520 + { 13521 + "Name": "Attendance Status", 13522 + "Type": "select", 13523 + "Values": [ 13524 + { 13525 + "text": "Attended", 13526 + "value": "attended" 13527 + }, 13528 + { 13529 + "text": "Not Attended", 13530 + "value": "not_attended" 13531 + }, 13532 + { 13533 + "text":"checks", 13534 + "value":"checks" 13535 + }, 13536 + { 13537 + "text":"c", 13538 + "value":"c" 13539 + } 13540 + ] 13541 + }, 13542 + { 13543 + "Name": "Price", 13544 + "Type": "text" 13545 + }, 13546 + { 13547 + "Name": "Name", 13548 + "Type": "select", 13549 + "Values": [ 13550 + { 13551 + "text": "Webinar 1", 13552 + "value": "Webinar_1" 13553 + }, 13554 + { 13555 + "text": "Webinar 2", 13556 + "value": "Webinar_2" 13557 + } 13558 + ] 13559 + }, 13560 + { 13561 + "Name": "Transaction Date", 13562 + "Type": "text" 13563 + }, 13564 + { 13565 + "Name": "id", 13566 + "Type": "text" 13567 + }, 13568 + { 13569 + "Name": "activity_time", 13570 + "Type": "text" 13571 + } 13572 + ] 13573 + } 13574 + ] 13575 +} 13576 +{{/code}} 13577 + 13578 + 13579 + 13580 + 13581 + 13582 + 13375 13375 (% id="HPOSTAddUsertoEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 13376 13376 == (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#ad7a03" %)POST(% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %) Add User to Engagement(%%) == 13377 13377 ... ... @@ -13514,7 +13514,7 @@ 13514 13514 (% id="HCOMPONENT:Segments" class="western" %) 13515 13515 === **COMPONENT: Segments** === 13516 13516 13517 -* 13725 +* 13518 13518 ** === 13519 13519 13520 13520 (% class="western" %) ... ... @@ -14007,7 +14007,7 @@ 14007 14007 (% id="HCOMPONENT:Leads" class="western" %) 14008 14008 === **COMPONENT: Leads** === 14009 14009 14010 -* 14218 +* 14011 14011 ** === 14012 14012 14013 14013 (% class="western" %) ... ... @@ -15184,3 +15184,84 @@ 15184 15184 (% class="western" %) 15185 15185 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. 15186 15186 ))) 15395 + 15396 +**Example 1: How to use API to unsubscribe user from package if you don't have a package ID or term ID** 15397 + 15398 +**~1. Get all packages using below API call** 15399 + 15400 +[[https:~~/~~/api.onecount.net/v2/products?limit=10000>>url:https://api.onecount.net/v2/products?limit=10000]] 15401 +\\This will give all the packages with all the resources attached to that package below is sample response. 15402 + 15403 + 15404 +[ 15405 + 15406 + { 15407 + 15408 + "ProductId": 2374, 15409 + 15410 + "Title": "OptL-0- ENTECH EVENT-VSL Virtual Seminars", 15411 + 15412 + "Description": "", 15413 + 15414 + "ResourceIDs": [ 15415 + 15416 + 16366, 15417 + 15418 + 16374, 15419 + 15420 + 16638, 15421 + 15422 + 16646, 15423 + 15424 + 17030, 15425 + 15426 + 17038, 15427 + 15428 + 17046, 15429 + 15430 + 17054 15431 + 15432 + ], 15433 + 15434 + "PrimaryFormID": [ 15435 + 15436 + "251fc466-0f68-483d-afa6-1b05cb3ae9b0" 15437 + 15438 + ], 15439 + 15440 + "Terms": { 15441 + 15442 + "Id": 2462, 15443 + 15444 + "Name": "Active", 15445 + 15446 + "Description": "", 15447 + 15448 + "Duration": 1, 15449 + 15450 + "DurationUnit": "D", 15451 + 15452 + "Price": "0", 15453 + 15454 + "ProductId": 2374 15455 + 15456 + } 15457 + 15458 + } 15459 + 15460 +] 15461 + 15462 + 15463 +FYI : ResourceIDs are product ids 15464 + 15465 +Productid is package id 15466 +\\If your desired resource is in the package then use the product id and term id to unsubscribe user from that package 15467 + 15468 +**2. Use product id and term id from the response above to unsubscribe user from the package** 15469 +\\Use this API and body to unsubscribe users 15470 +\\[[https:~~/~~/api.onecount.net/v2/transactions>>url:https://api.onecount.net/v2/transactions]] 15471 +\\**BODY:** 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 package 15474 + 15475 +