Changes for page ONEcount API Documentation
Last modified by Rayaan Ahmed on 2025/02/09 22:20
To version 10.1
edited by Rayaan Ahmed
on 2024/02/27 18:43
on 2024/02/27 18:43
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
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 ... ... @@ -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 JSONobject 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 JSONobject 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 ((( ... ... @@ -1168,7 +1168,7 @@ 1168 1168 )))|(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 1169 1169 ((( 1170 1170 (% class="western" %) 1171 -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. 1172 1172 ))) 1173 1173 |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 1174 1174 ((( ... ... @@ -1640,9 +1640,6 @@ 1640 1640 1641 1641 (% class="western" %) 1642 1642 JSON of the Questions type object needs to be sent as post data. Id field is mandatory for update. 1643 - 1644 -(% class="western" %) 1645 -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. 1646 1646 ))) 1647 1647 1648 1648 (% id="HGETAllQuestions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) ... ... @@ -8158,9 +8158,8 @@ 8158 8158 (% id="HPUTUpdatequestion" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 8159 8159 == (% 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(%%) == 8160 8160 8139 +---- 8161 8161 8162 -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. 8163 - 8164 8164 {{panel bgColor="#D3D3D3" width="100%"}} 8165 8165 (% class="nolink" %)https:~/~/api.onecount.net/v2(% style="color:#212121" %)/questions/~{~{QUESTION ID}} 8166 8166 {{/panel}} ... ... @@ -12891,16 +12891,7 @@ 12891 12891 12892 12892 (% class="western" %) 12893 12893 Parameters required to update the engagement needs to be sent as post data in JSON format. 12894 - 12895 -(% class="western" %) 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" %)/engagements/metric/<engagement id>|(% style="text-align:left; vertical-align:top" %)((( 12899 -Add options to specific metric in an engagement without passing all options and overriding existing options. 12900 - 12901 -Parameters required to update the engagement needs to be sent as post data in JSON format. 12902 -\\This API is used to add options only for select and checkbox metrics. 12903 -))) 12904 12904 |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 12905 12905 ((( 12906 12906 (% class="western" %) ... ... @@ -13377,141 +13377,6 @@ 13377 13377 {{/code}} 13378 13378 13379 13379 13380 -(% id="HPUTUpdateEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 13381 -== (% 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(%%) == 13382 - 13383 ----- 13384 - 13385 -{{panel bgColor="#D3D3D3" width="100%"}} 13386 - (% class="nolink" %)https:~/~/api.onecount.net/v2(%%)/engagements/metric/(% style="color:#212121" %)~{~{Engagement Id}} 13387 -{{/panel}} 13388 - 13389 -=== (% class="core-title" style="color:#212121" %)Request Headers(%%) === 13390 - 13391 ----- 13392 - 13393 -(% 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}} 13394 - 13395 -=== (% style="color:#212121" %)Body (% style="color:#6b6b6b" %)raw (json)(%%) === 13396 - 13397 ----- 13398 - 13399 -{{code language="yml" title="Body"}} 13400 -{"Metrics":[ 13401 - {"Attendance Status":[{"text":"checks","value":"checks"},{"text":"c","value":"c"}]}, 13402 - {"lagacy status":[{"text":"c","value":"c"}]} 13403 - ]} 13404 -{{/code}} 13405 - 13406 -==== Example ==== 13407 - 13408 ----- 13409 - 13410 -(% style="color:#6b6b6b" %)Request 13411 - 13412 -{{code language="php" title="(% class=~"documentation-core-item-request-name jbmEtY sc-fzomuh~" style=~"color:#212121~" %)Add options to metric"}} 13413 - <?php 13414 - 13415 -$curl = curl_init(); 13416 - 13417 -curl_setopt_array($curl, array( 13418 - CURLOPT_URL => 'https://api.onecount.net/v2/engagements/metric/{{Engagement Id}}', 13419 - CURLOPT_RETURNTRANSFER => true, 13420 - CURLOPT_ENCODING => '', 13421 - CURLOPT_MAXREDIRS => 10, 13422 - CURLOPT_TIMEOUT => 0, 13423 - CURLOPT_FOLLOWLOCATION => true, 13424 - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 13425 - CURLOPT_CUSTOMREQUEST => 'PUT', 13426 - CURLOPT_POSTFIELDS =>'{"Metrics":[ 13427 - {"Attendance Status":[{"text":"checks","value":"checks"},{"text":"c","value":"c"}]}, 13428 - {"lagacy status":[{"text":"c","value":"c"}]} 13429 - ]}', 13430 - CURLOPT_HTTPHEADER => array( 13431 - 'Appkey: {{ONECOUNT API KEY}}', 13432 - 'Content-Type: application/json' 13433 - ), 13434 -)); 13435 - 13436 -$response = curl_exec($curl); 13437 - 13438 -curl_close($curl); 13439 -echo $response; 13440 - 13441 -{{/code}} 13442 - 13443 - 13444 -(% style="color:#6b6b6b" %)Response 200 OK 13445 - 13446 -{{code language="yml" theme="RDark" collapse="true" title="Update Engagement Response"}} 13447 -{ 13448 - "result": { 13449 - "success": "1", 13450 - "error": { 13451 - "code": "", 13452 - "message": "" 13453 - } 13454 - }, 13455 - "Engagements": [ 13456 - { 13457 - "Id": "e0e816ec-77ba-4db1-bfc0-22d340337357", 13458 - "Name": "Test engagement 3", 13459 - "Metrics": [ 13460 - { 13461 - "Name": "Attendance Status", 13462 - "Type": "select", 13463 - "Values": [ 13464 - { 13465 - "text": "Attended", 13466 - "value": "attended" 13467 - }, 13468 - { 13469 - "text": "Not Attended", 13470 - "value": "not_attended" 13471 - } 13472 - ] 13473 - }, 13474 - { 13475 - "Name": "Price", 13476 - "Type": "text" 13477 - }, 13478 - { 13479 - "Name": "Name", 13480 - "Type": "select", 13481 - "Values": [ 13482 - { 13483 - "text": "Webinar 1", 13484 - "value": "Webinar_1" 13485 - }, 13486 - { 13487 - "text": "Webinar 2", 13488 - "value": "Webinar_2" 13489 - } 13490 - ] 13491 - }, 13492 - { 13493 - "Name": "Transaction Date", 13494 - "Type": "text" 13495 - }, 13496 - { 13497 - "Name": "id", 13498 - "Type": "text" 13499 - }, 13500 - { 13501 - "Name": "activity_time", 13502 - "Type": "text" 13503 - } 13504 - ] 13505 - } 13506 - ] 13507 -} 13508 -{{/code}} 13509 - 13510 - 13511 - 13512 - 13513 - 13514 - 13515 13515 (% id="HPOSTAddUsertoEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 13516 13516 == (% 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(%%) == 13517 13517 ... ... @@ -14420,6 +14420,7 @@ 14420 14420 Alias for admin purpose. 14421 14421 ))) 14422 14422 14256 + 14423 14423 (% class="western" %) 14424 14424 **Type: Choices** 14425 14425 ... ... @@ -15324,3 +15324,4 @@ 15324 15324 (% class="western" %) 15325 15325 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. 15326 15326 ))) 15161 +