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

From version 14.1
edited by Rayaan Ahmed
on 2025/02/09 22:08
Change comment: There is no comment for this version
To version 9.1
edited by Rayaan Ahmed
on 2024/02/26 11:24
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -58,7 +58,6 @@
58 58  11. Get specific engagement by engagement id
59 59  11. Create Engagements
60 60  11. Update Engagements
61 -11. Add options to metric for an engagement
62 62  11. Add users data to Engagement
63 63  1. Segments
64 64  11. Get all Segments
... ... @@ -66,6 +66,7 @@
66 66  11. Add users to segment
67 67  11. Get all segment ids for a user
68 68  
68 +
69 69  (% class="western" %)
70 70  **Accessing API**
71 71  
... ... @@ -96,6 +96,7 @@
96 96  Any JSON data or JSON files containing information needed for requests, such as updating a record with new information.
97 97  )))
98 98  
99 +
99 99  (% class="western" %)
100 100  **General API Usage**
101 101  
... ... @@ -148,13 +148,13 @@
148 148  === **COMPONENT: Users** ===
149 149  
150 150  (% class="western" %)
151 -Users means the customers of your system. Users can be added, updated and searched for using the users resource from the api. For lookup, If a return parameter is specified Users JSON object will have those fields. If nothing is specified by default only UserId is returned.
152 +Users means the customers of your system. Users can be added, updated and searched for using the users resource from the api. For lookup, If a return parameter is specified Users object will have those fields. If nothing is specified by default only UserId is returned.
152 152  
153 153  (% class="western" %)
154 154  Additionally (Array of) transaction object specifying parts of the transaction to be added to the new user can be specified. UserId, TransactionId and SubscriptionType will be ignored if specified for this case. As this is new user and new transaction is being added.
155 155  
156 156  (% class="western" %)
157 -In this case the provided demographic information in users JSON object will be used to create a new user in ONEcount and then a response will be generated. Before creating a new user, a check for duplicate will be performed based on Dedupe columns and if found, and error code will be generated.
158 +In this case the provided demographic information in users object will be used to create a new user in ONEcount and then a response will be generated. Before creating a new user, a check for duplicate will be performed based on Dedupe columns and if found, and error code will be generated.
158 158  
159 159  (% class="western" %)
160 160  If username and password is not one of the parameters being passed, then a random username and password will be generated for the user while creating his user account in ONEcount.
... ... @@ -236,25 +236,7 @@
236 236  Create a new users
237 237  
238 238  (% class="western" %)
239 -Parameters required to create the user needs to be sent as post data in JSON format. Below is the example of data
240 -\\Example:
241 -
242 -(% class="western" %)
243 -{"Users":{"PartnerId":1,"Demo":{"1":"rayaan@onecount.net","4":"Rayaan","5":"Ahmed"}},"DedupeColumns":"1","Transactions":[],"Return":"4,5,1"}
244 -
245 -
246 -(% class="western" %)
247 -1) PartherId is required, this can be any integer value.
248 -
249 -(% class="western" %)
250 -2) Demo is required it contains JSON object of user demographic information key as demo id and value as actual information of user.
251 -
252 -(% class="western" %)
253 -3) DedupeColumn is required, this contains demo id as value, used to check duplicate user based on demo id.
254 -
255 -(% class="western" %)
256 -4) Transactions is required, If user does not have any transaction pass empty array if user has a transaction pass transaction JSON object. please refer transaction API body for JSON object.
257 -
240 +Parameters required to create the user needs to be sent as post data in JSON format.
258 258  )))
259 259  |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %)
260 260  (((
... ... @@ -330,6 +330,10 @@
330 330  
331 331  ----
332 332  
316 +{{panel bgColor="#D3D3D3" width="100%"}}
317 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users
318 +{{/panel}}
319 +
333 333  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
334 334  
335 335  ----
... ... @@ -864,6 +864,12 @@
864 864  
865 865  ----
866 866  
854 +{{panel bgColor="#D3D3D3" width="100%"}}
855 + (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users/(% style="color:#212121" %)~{~{OCID}}
856 +{{/panel}}
857 +
858 +=== (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
859 +
867 867  ----
868 868  
869 869  (% 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}}
... ... @@ -956,6 +956,10 @@
956 956  
957 957  ----
958 958  
952 +{{panel bgColor="#D3D3D3" width="100%"}}
953 + (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users(% class="nolink" style="color:#212121" %)/login
954 +{{/panel}}
955 +
959 959  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
960 960  
961 961  ----
... ... @@ -1026,6 +1026,10 @@
1026 1026  
1027 1027  ----
1028 1028  
1026 +{{panel bgColor="#D3D3D3" width="100%"}}
1027 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users(% class="nolink" style="color:#212121" %)/lookup?2=user_242_6298&return=1,2,3,4
1028 +{{/panel}}
1029 +
1029 1029  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
1030 1030  
1031 1031  ----
... ... @@ -1102,6 +1102,10 @@
1102 1102  
1103 1103  ----
1104 1104  
1106 +{{panel bgColor="#D3D3D3" width="100%"}}
1107 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2(% class="nolink" style="color:#212121" %)/users/~{~{OCID}}/partners/~{~{Partner id}}
1108 +{{/panel}}
1109 +
1105 1105  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
1106 1106  
1107 1107  ----
... ... @@ -1113,7 +1113,11 @@
1113 1113  
1114 1114  ----
1115 1115  
1121 +{{panel bgColor="#D3D3D3" width="100%"}}
1122 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users
1123 +{{/panel}}
1116 1116  
1125 +
1117 1117  (% class="western" %)
1118 1118  **POST method should be used to create users.**
1119 1119  
... ... @@ -1142,7 +1142,7 @@
1142 1142  )))|(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %)
1143 1143  (((
1144 1144  (% class="western" %)
1145 -Users object that contains information about user to create. PartnerId Needs to be specified. PartnerId is any integer value.
1154 +Users object that contains information about user to create. PartnerId Needs to be specified.
1146 1146  )))
1147 1147  |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %)
1148 1148  (((
... ... @@ -1282,7 +1282,11 @@
1282 1282  
1283 1283  ----
1284 1284  
1294 +{{panel bgColor="#D3D3D3" width="100%"}}
1295 + (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users/~{~{OCID(% class="nolink" %)}}
1296 +{{/panel}}
1285 1285  
1298 +
1286 1286  (% class="western" %)
1287 1287  **PUT method should be used to update users.**
1288 1288  
... ... @@ -1610,11 +1610,9 @@
1610 1610  
1611 1611  (% class="western" %)
1612 1612  JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update.
1613 -
1614 -(% class="western" %)
1615 -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.
1616 1616  )))
1617 1617  
1628 +
1618 1618  (% id="HGETAllQuestions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
1619 1619  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Questions(%%) ==
1620 1620  
... ... @@ -8128,9 +8128,8 @@
8128 8128  (% id="HPUTUpdatequestion" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
8129 8129  == (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#0053b8" %)PUT (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)Update question(%%) ==
8130 8130  
8142 +----
8131 8131  
8132 -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.
8133 -
8134 8134  {{panel bgColor="#D3D3D3" width="100%"}}
8135 8135   (% class="nolink" %)https:~/~/api.onecount.net/v2(% style="color:#212121" %)/questions/~{~{QUESTION ID}}
8136 8136  {{/panel}}
... ... @@ -8312,6 +8312,7 @@
8312 8312  {"ProductID":"65","ResourceID":”121"}
8313 8313  )))
8314 8314  
8325 +
8315 8315  (% id="HGETAllProducts" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
8316 8316  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Products(%%) ==
8317 8317  
... ... @@ -9065,6 +9065,7 @@
9065 9065  JSON of the terms type object needs to be sent as post data. Id field is mandatory for update.
9066 9066  )))
9067 9067  
9079 +
9068 9068  (% id="HGETAllTerms" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
9069 9069  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Terms(%%) ==
9070 9070  
... ... @@ -9670,6 +9670,7 @@
9670 9670  JSON of the resources type object needs to be sent as post data. Id field is mandatory for update.
9671 9671  )))
9672 9672  
9685 +
9673 9673  (% id="HGETAllResources" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
9674 9674  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Resources(%%) ==
9675 9675  
... ... @@ -10135,97 +10135,7 @@
10135 10135  }
10136 10136  {{/code}}
10137 10137  
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(%%) ==
10140 10140  
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 -
10229 10229  (% id="HCOMPONENT:SourceCodes" class="western" %)
10230 10230  === **COMPONENT: Source Codes** ===
10231 10231  
... ... @@ -10302,6 +10302,7 @@
10302 10302  JSON of the Sources type object needs to be sent as post data. Id field is mandatory for update.
10303 10303  )))
10304 10304  
10228 +
10305 10305  (% id="HGETAllSourcecodes" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
10306 10306  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Source codes(%%) ==
10307 10307  
... ... @@ -10882,6 +10882,7 @@
10882 10882  JSON of the Transactions type object needs to be sent as post data. Id field should not be sent.
10883 10883  )))
10884 10884  
10809 +
10885 10885  (% id="HGETAllTransactions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
10886 10886  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Transactions(%%) ==
10887 10887  
... ... @@ -12951,16 +12951,7 @@
12951 12951  
12952 12952  (% class="western" %)
12953 12953  Parameters required to update the engagement needs to be sent as post data in JSON format.
12954 -
12955 -(% class="western" %)
12956 -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.
12957 12957  )))
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 -)))
12964 12964  |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %)
12965 12965  (((
12966 12966  (% class="western" %)
... ... @@ -12978,6 +12978,7 @@
12978 12978  Parameters required to add user to the engagement needs to be sent as post data in JSON format.
12979 12979  )))
12980 12980  
12897 +
12981 12981  (% id="HGETAllEngagements" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
12982 12982  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Engagements(%%) ==
12983 12983  
... ... @@ -13437,149 +13437,6 @@
13437 13437  {{/code}}
13438 13438  
13439 13439  
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 -
13583 13583  (% id="HPOSTAddUsertoEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13584 13584  == (% 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(%%) ==
13585 13585  
... ... @@ -13599,8 +13599,8 @@
13599 13599  
13600 13600  ----
13601 13601  
13602 -{{code language="yml" title="Body"}}
13603 -{"engagement id":"e0e816ec-77ba-4db1-bfc0-22d340337357","name":"Webinar_1","ocid":"1845775", "date":"2023-12-31 14:12:38", "data":{"price":"10","attendance_status":"not_attended"},"segment":{}}
13376 +{{code language="yml" theme="RDark" title="Body"}}
13377 +{"engagement id":"e0e816ec-77ba-4db1-bfc0-22d340337357","show id":"Webinar_1","ocid":"1845775", "date":"2023-12-31 14:12:38", "data":{"price":"10","attendance_status":"not_attended"},"segment":{}}
13604 13604  {{/code}}
13605 13605  
13606 13606  ==== Example ====
... ... @@ -13609,7 +13609,7 @@
13609 13609  
13610 13610  (% style="color:#6b6b6b" %)Request
13611 13611  
13612 -{{code language="php" title="Add User to Engagement Request"}}
13386 +{{code language="php" theme="RDark" title="Add User to Engagement Request"}}
13613 13613   <?php
13614 13614  
13615 13615  $curl = curl_init();
... ... @@ -13623,7 +13623,7 @@
13623 13623   CURLOPT_FOLLOWLOCATION => true,
13624 13624   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13625 13625   CURLOPT_CUSTOMREQUEST => 'POST',
13626 - CURLOPT_POSTFIELDS =>'{"engagement id":"e0e816ec-77ba-4db1-bfc0-22d340337357","name":"Webinar_1","ocid":"1845775", "date":"2023-12-31 14:12:38", "data":{"price":"10","attendance_status":"not_attended"},"segment":{}}',
13400 + CURLOPT_POSTFIELDS =>'{"engagement id":"e0e816ec-77ba-4db1-bfc0-22d340337357","show id":"Webinar_1","ocid":"1845775", "date":"2023-12-31 14:12:38", "data":{"price":"10","attendance_status":"not_attended"},"segment":{}}',
13627 13627   CURLOPT_HTTPHEADER => array(
13628 13628   'Appkey: {{ONECOUNT API KEY}}'
13629 13629   ),
... ... @@ -13794,6 +13794,7 @@
13794 13794  Get all segment user has be subscribed based on user id.
13795 13795  )))
13796 13796  
13571 +
13797 13797  (% id="HGETAllSegments" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13798 13798  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Segments(%%) ==
13799 13799  
... ... @@ -14281,6 +14281,7 @@
14281 14281  JSON of the Telemarketing type object needs to be sent as post data. Id field should not be sent.
14282 14282  )))
14283 14283  
14059 +
14284 14284  (% class="western" %)
14285 14285  POST method can be used to create telemarketing stat. Telemarketing info needs to be sent as request and an Id will be returned when the transaction is created.
14286 14286  
... ... @@ -14395,6 +14395,7 @@
14395 14395  Returns telemarketing ids of the newly created transaction. If multiple stats are sent, multiple ids are returned in cvs format.
14396 14396  )))
14397 14397  
14174 +
14398 14398  (% class="western" %)
14399 14399  **API REFERENCE**
14400 14400  
... ... @@ -14488,6 +14488,8 @@
14488 14488  Alias for admin purpose.
14489 14489  )))
14490 14490  
14268 +
14269 +
14491 14491  (% class="western" %)
14492 14492  **Type: Choices**
14493 14493  
... ... @@ -14571,6 +14571,7 @@
14571 14571  Tied to which question id.
14572 14572  )))
14573 14573  
14353 +
14574 14574  (% class="western" %)
14575 14575  **Type: Users**
14576 14576  
... ... @@ -14641,6 +14641,7 @@
14641 14641  Request date.
14642 14642  )))
14643 14643  
14424 +
14644 14644  (% class="western" %)
14645 14645  **Type: Demo**
14646 14646  
... ... @@ -14698,6 +14698,7 @@
14698 14698  ...
14699 14699  )))
14700 14700  
14482 +
14701 14701  (% class="western" %)
14702 14702  **Type: Transactions**
14703 14703  
... ... @@ -14885,6 +14885,7 @@
14885 14885  If there is amount (USD) included in transaction.
14886 14886  )))
14887 14887  
14670 +
14888 14888  (% class="western" %)
14889 14889  **Type: Sources**
14890 14890  
... ... @@ -14955,6 +14955,7 @@
14955 14955  If this is a child source then list the parent source id.
14956 14956  )))
14957 14957  
14741 +
14958 14958  (% class="western" %)
14959 14959  **Type: Products**
14960 14960  
... ... @@ -15025,6 +15025,7 @@
15025 15025  (Array of) Terms associated with the product.
15026 15026  )))
15027 15027  
14812 +
15028 15028  (% class="western" %)
15029 15029  **Type: Terms**
15030 15030  
... ... @@ -15134,6 +15134,7 @@
15134 15134  If there is price (USD) for the term.
15135 15135  )))
15136 15136  
14922 +
15137 15137  (% class="western" %)
15138 15138  **Type: Resources**
15139 15139  
... ... @@ -15277,6 +15277,7 @@
15277 15277  Default value is 0. This parameter is used to provide access to protected content.
15278 15278  )))
15279 15279  
15066 +
15280 15280  (% class="western" %)
15281 15281  **Type: Telemarketing**
15282 15282  
... ... @@ -15393,83 +15393,4 @@
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 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 15475