Changes for page ONEcount API Documentation
Last modified by Rayaan Ahmed on 2025/02/09 22:20
To version 8.2
edited by Rayaan Ahmed
on 2024/02/26 11:24
on 2024/02/26 11:24
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 ... ... @@ -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 JSONobject 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 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.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 ((( ... ... @@ -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.1154 +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,11 +1640,9 @@ 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 1628 + 1648 1648 (% id="HGETAllQuestions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 1649 1649 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Questions(%%) == 1650 1650 ... ... @@ -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 8142 +---- 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}} ... ... @@ -8342,6 +8342,7 @@ 8342 8342 {"ProductID":"65","ResourceID":”121"} 8343 8343 ))) 8344 8344 8325 + 8345 8345 (% id="HGETAllProducts" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 8346 8346 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Products(%%) == 8347 8347 ... ... @@ -9095,6 +9095,7 @@ 9095 9095 JSON of the terms type object needs to be sent as post data. Id field is mandatory for update. 9096 9096 ))) 9097 9097 9079 + 9098 9098 (% id="HGETAllTerms" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 9099 9099 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Terms(%%) == 9100 9100 ... ... @@ -9700,6 +9700,7 @@ 9700 9700 JSON of the resources type object needs to be sent as post data. Id field is mandatory for update. 9701 9701 ))) 9702 9702 9685 + 9703 9703 (% id="HGETAllResources" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 9704 9704 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Resources(%%) == 9705 9705 ... ... @@ -10242,6 +10242,7 @@ 10242 10242 JSON of the Sources type object needs to be sent as post data. Id field is mandatory for update. 10243 10243 ))) 10244 10244 10228 + 10245 10245 (% id="HGETAllSourcecodes" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 10246 10246 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Source codes(%%) == 10247 10247 ... ... @@ -10822,6 +10822,7 @@ 10822 10822 JSON of the Transactions type object needs to be sent as post data. Id field should not be sent. 10823 10823 ))) 10824 10824 10809 + 10825 10825 (% id="HGETAllTransactions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 10826 10826 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Transactions(%%) == 10827 10827 ... ... @@ -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" %) ... ... @@ -12918,6 +12918,7 @@ 12918 12918 Parameters required to add user to the engagement needs to be sent as post data in JSON format. 12919 12919 ))) 12920 12920 12897 + 12921 12921 (% id="HGETAllEngagements" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 12922 12922 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Engagements(%%) == 12923 12923 ... ... @@ -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 ... ... @@ -13531,8 +13531,8 @@ 13531 13531 13532 13532 ---- 13533 13533 13534 -{{code language="yml" title="Body"}} 13535 -{"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":{}} 13536 13536 {{/code}} 13537 13537 13538 13538 ==== Example ==== ... ... @@ -13541,7 +13541,7 @@ 13541 13541 13542 13542 (% style="color:#6b6b6b" %)Request 13543 13543 13544 -{{code language="php" title="Add User to Engagement Request"}} 13386 +{{code language="php" theme="RDark" title="Add User to Engagement Request"}} 13545 13545 <?php 13546 13546 13547 13547 $curl = curl_init(); ... ... @@ -13555,7 +13555,7 @@ 13555 13555 CURLOPT_FOLLOWLOCATION => true, 13556 13556 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 13557 13557 CURLOPT_CUSTOMREQUEST => 'POST', 13558 - 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":{}}', 13559 13559 CURLOPT_HTTPHEADER => array( 13560 13560 'Appkey: {{ONECOUNT API KEY}}' 13561 13561 ), ... ... @@ -13726,6 +13726,7 @@ 13726 13726 Get all segment user has be subscribed based on user id. 13727 13727 ))) 13728 13728 13571 + 13729 13729 (% id="HGETAllSegments" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 13730 13730 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Segments(%%) == 13731 13731 ... ... @@ -14213,6 +14213,7 @@ 14213 14213 JSON of the Telemarketing type object needs to be sent as post data. Id field should not be sent. 14214 14214 ))) 14215 14215 14059 + 14216 14216 (% class="western" %) 14217 14217 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. 14218 14218 ... ... @@ -14327,6 +14327,7 @@ 14327 14327 Returns telemarketing ids of the newly created transaction. If multiple stats are sent, multiple ids are returned in cvs format. 14328 14328 ))) 14329 14329 14174 + 14330 14330 (% class="western" %) 14331 14331 **API REFERENCE** 14332 14332 ... ... @@ -14420,6 +14420,8 @@ 14420 14420 Alias for admin purpose. 14421 14421 ))) 14422 14422 14268 + 14269 + 14423 14423 (% class="western" %) 14424 14424 **Type: Choices** 14425 14425 ... ... @@ -14503,6 +14503,7 @@ 14503 14503 Tied to which question id. 14504 14504 ))) 14505 14505 14353 + 14506 14506 (% class="western" %) 14507 14507 **Type: Users** 14508 14508 ... ... @@ -14573,6 +14573,7 @@ 14573 14573 Request date. 14574 14574 ))) 14575 14575 14424 + 14576 14576 (% class="western" %) 14577 14577 **Type: Demo** 14578 14578 ... ... @@ -14630,6 +14630,7 @@ 14630 14630 ... 14631 14631 ))) 14632 14632 14482 + 14633 14633 (% class="western" %) 14634 14634 **Type: Transactions** 14635 14635 ... ... @@ -14817,6 +14817,7 @@ 14817 14817 If there is amount (USD) included in transaction. 14818 14818 ))) 14819 14819 14670 + 14820 14820 (% class="western" %) 14821 14821 **Type: Sources** 14822 14822 ... ... @@ -14887,6 +14887,7 @@ 14887 14887 If this is a child source then list the parent source id. 14888 14888 ))) 14889 14889 14741 + 14890 14890 (% class="western" %) 14891 14891 **Type: Products** 14892 14892 ... ... @@ -14957,6 +14957,7 @@ 14957 14957 (Array of) Terms associated with the product. 14958 14958 ))) 14959 14959 14812 + 14960 14960 (% class="western" %) 14961 14961 **Type: Terms** 14962 14962 ... ... @@ -15066,6 +15066,7 @@ 15066 15066 If there is price (USD) for the term. 15067 15067 ))) 15068 15068 14922 + 15069 15069 (% class="western" %) 15070 15070 **Type: Resources** 15071 15071 ... ... @@ -15209,6 +15209,7 @@ 15209 15209 Default value is 0. This parameter is used to provide access to protected content. 15210 15210 ))) 15211 15211 15066 + 15212 15212 (% class="western" %) 15213 15213 **Type: Telemarketing** 15214 15214 ... ... @@ -15324,3 +15324,5 @@ 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 ))) 15182 + 15183 +