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

From version 12.1
edited by Admin User
on 2024/04/29 14:06
Change comment: There is no comment for this version
To version 10.1
edited by Rayaan Ahmed
on 2024/02/27 18:43
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
... ... @@ -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
... ... @@ -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.
150 +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.
156 +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 -
238 +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  
314 +{{panel bgColor="#D3D3D3" width="100%"}}
315 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users
316 +{{/panel}}
317 +
333 333  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
334 334  
335 335  ----
... ... @@ -864,6 +864,12 @@
864 864  
865 865  ----
866 866  
852 +{{panel bgColor="#D3D3D3" width="100%"}}
853 + (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users/(% style="color:#212121" %)~{~{OCID}}
854 +{{/panel}}
855 +
856 +=== (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
857 +
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  
950 +{{panel bgColor="#D3D3D3" width="100%"}}
951 + (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users(% class="nolink" style="color:#212121" %)/login
952 +{{/panel}}
953 +
959 959  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
960 960  
961 961  ----
... ... @@ -1026,6 +1026,10 @@
1026 1026  
1027 1027  ----
1028 1028  
1024 +{{panel bgColor="#D3D3D3" width="100%"}}
1025 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users(% class="nolink" style="color:#212121" %)/lookup?2=user_242_6298&return=1,2,3,4
1026 +{{/panel}}
1027 +
1029 1029  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
1030 1030  
1031 1031  ----
... ... @@ -1102,6 +1102,10 @@
1102 1102  
1103 1103  ----
1104 1104  
1104 +{{panel bgColor="#D3D3D3" width="100%"}}
1105 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2(% class="nolink" style="color:#212121" %)/users/~{~{OCID}}/partners/~{~{Partner id}}
1106 +{{/panel}}
1107 +
1105 1105  === (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
1106 1106  
1107 1107  ----
... ... @@ -1113,7 +1113,11 @@
1113 1113  
1114 1114  ----
1115 1115  
1119 +{{panel bgColor="#D3D3D3" width="100%"}}
1120 +(% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users
1121 +{{/panel}}
1116 1116  
1123 +
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.
1152 +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  
1292 +{{panel bgColor="#D3D3D3" width="100%"}}
1293 + (% class="nolink nolink" %)https:~/~/api.onecount.net/v2/users/~{~{OCID(% class="nolink" %)}}
1294 +{{/panel}}
1285 1285  
1296 +
1286 1286  (% class="western" %)
1287 1287  **PUT method should be used to update users.**
1288 1288  
... ... @@ -1610,9 +1610,6 @@
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  
1618 1618  (% id="HGETAllQuestions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
... ... @@ -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  
8139 +----
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}}
... ... @@ -10139,7 +10139,7 @@
10139 10139  (% id="HCOMPONENT:SourceCodes" class="western" %)
10140 10140  === **COMPONENT: Source Codes** ===
10141 10141  
10142 -*
10149 +*
10143 10143  ** ===
10144 10144  
10145 10145  (% class="western" %)
... ... @@ -12861,16 +12861,7 @@
12861 12861  
12862 12862  (% class="western" %)
12863 12863  Parameters required to update the engagement needs to be sent as post data in JSON format.
12864 -
12865 -(% class="western" %)
12866 -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.
12867 12867  )))
12868 -|(% 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" %)(((
12869 -Add options to specific metric in an engagement without passing all options and overriding existing options.
12870 -
12871 -Parameters required to update the engagement needs to be sent as post data in JSON format.
12872 -\\This API is used to add options only for select and checkbox metrics.
12873 -)))
12874 12874  |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %)
12875 12875  (((
12876 12876  (% class="western" %)
... ... @@ -13347,149 +13347,6 @@
13347 13347  {{/code}}
13348 13348  
13349 13349  
13350 -(% id="HPUTUpdateEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13351 -== (% 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(%%) ==
13352 -
13353 -----
13354 -
13355 -{{panel bgColor="#D3D3D3" width="100%"}}
13356 - (% class="nolink" %)https:~/~/api.onecount.net/v2(%%)/engagements/metric/(% style="color:#212121" %)~{~{Engagement Id}}
13357 -{{/panel}}
13358 -
13359 -=== (% class="core-title" style="color:#212121" %)Request Headers(%%) ===
13360 -
13361 -----
13362 -
13363 -(% 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}}
13364 -
13365 -=== (% style="color:#212121" %)Body (% style="color:#6b6b6b" %)raw (json)(%%) ===
13366 -
13367 -----
13368 -
13369 -{{code language="yml" title="Body"}}
13370 -{"Metrics":[
13371 - {"Attendance Status":[{"text":"checks","value":"checks"},{"text":"c","value":"c"}]},
13372 - {"lagacy status":[{"text":"c","value":"c"}]}
13373 - ]}
13374 -{{/code}}
13375 -
13376 -==== Example ====
13377 -
13378 -----
13379 -
13380 -(% style="color:#6b6b6b" %)Request
13381 -
13382 -{{code language="php" title="(% class=~"documentation-core-item-request-name jbmEtY sc-fzomuh~" style=~"color:#212121~" %)Add options to metric"}}
13383 - <?php
13384 -
13385 -$curl = curl_init();
13386 -
13387 -curl_setopt_array($curl, array(
13388 - CURLOPT_URL => 'https://api.onecount.net/v2/engagements/metric/{{Engagement Id}}',
13389 - CURLOPT_RETURNTRANSFER => true,
13390 - CURLOPT_ENCODING => '',
13391 - CURLOPT_MAXREDIRS => 10,
13392 - CURLOPT_TIMEOUT => 0,
13393 - CURLOPT_FOLLOWLOCATION => true,
13394 - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13395 - CURLOPT_CUSTOMREQUEST => 'PUT',
13396 - CURLOPT_POSTFIELDS =>'{"Metrics":[
13397 - {"Attendance Status":[{"text":"checks","value":"checks"},{"text":"c","value":"c"}]},
13398 - {"lagacy status":[{"text":"c","value":"c"}]}
13399 - ]}',
13400 - CURLOPT_HTTPHEADER => array(
13401 - 'Appkey: {{ONECOUNT API KEY}}',
13402 - 'Content-Type: application/json'
13403 - ),
13404 -));
13405 -
13406 -$response = curl_exec($curl);
13407 -
13408 -curl_close($curl);
13409 -echo $response;
13410 -
13411 -{{/code}}
13412 -
13413 -
13414 -(% style="color:#6b6b6b" %)Response  200 OK
13415 -
13416 -{{code language="yml" title="(% class=~"documentation-core-item-request-name jbmEtY sc-fzomuh~" style=~"color:#212121~" %)Add options to metric"}}
13417 -{
13418 - "result": {
13419 - "success": "1",
13420 - "error": {
13421 - "code": "",
13422 - "message": ""
13423 - }
13424 - },
13425 - "Engagements": [
13426 - {
13427 - "Id": "e0e816ec-77ba-4db1-bfc0-22d340337357",
13428 - "Name": "Test engagement 3",
13429 - "Metrics": [
13430 - {
13431 - "Name": "Attendance Status",
13432 - "Type": "select",
13433 - "Values": [
13434 - {
13435 - "text": "Attended",
13436 - "value": "attended"
13437 - },
13438 - {
13439 - "text": "Not Attended",
13440 - "value": "not_attended"
13441 - },
13442 - {
13443 - "text":"checks",
13444 - "value":"checks"
13445 - },
13446 - {
13447 - "text":"c",
13448 - "value":"c"
13449 - }
13450 - ]
13451 - },
13452 - {
13453 - "Name": "Price",
13454 - "Type": "text"
13455 - },
13456 - {
13457 - "Name": "Name",
13458 - "Type": "select",
13459 - "Values": [
13460 - {
13461 - "text": "Webinar 1",
13462 - "value": "Webinar_1"
13463 - },
13464 - {
13465 - "text": "Webinar 2",
13466 - "value": "Webinar_2"
13467 - }
13468 - ]
13469 - },
13470 - {
13471 - "Name": "Transaction Date",
13472 - "Type": "text"
13473 - },
13474 - {
13475 - "Name": "id",
13476 - "Type": "text"
13477 - },
13478 - {
13479 - "Name": "activity_time",
13480 - "Type": "text"
13481 - }
13482 - ]
13483 - }
13484 - ]
13485 -}
13486 -{{/code}}
13487 -
13488 -
13489 -
13490 -
13491 -
13492 -
13493 13493  (% id="HPOSTAddUsertoEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13494 13494  == (% 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(%%) ==
13495 13495  
... ... @@ -13632,7 +13632,7 @@
13632 13632  (% id="HCOMPONENT:Segments" class="western" %)
13633 13633  === **COMPONENT: Segments** ===
13634 13634  
13635 -*
13490 +*
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 -*
13983 +*
14129 14129  ** ===
14130 14130  
14131 14131  (% class="western" %)
... ... @@ -14398,6 +14398,7 @@
14398 14398  Alias for admin purpose.
14399 14399  )))
14400 14400  
14256 +
14401 14401  (% class="western" %)
14402 14402  **Type: Choices**
14403 14403  
... ... @@ -15302,3 +15302,4 @@
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  )))
15161 +