Changes for page ONEcount API Documentation
Last modified by Rayaan Ahmed on 2025/02/09 22:20
From version 9.1
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,6 +58,7 @@ 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 61 61 11. Add users data to Engagement 62 62 1. Segments 63 63 11. Get all Segments ... ... @@ -65,7 +65,6 @@ 65 65 11. Add users to segment 66 66 11. Get all segment ids for a user 67 67 68 - 69 69 (% class="western" %) 70 70 **Accessing API** 71 71 ... ... @@ -96,7 +96,6 @@ 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 - 100 100 (% class="western" %) 101 101 **General API Usage** 102 102 ... ... @@ -149,13 +149,13 @@ 149 149 === **COMPONENT: Users** === 150 150 151 151 (% class="western" %) 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. 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. 153 153 154 154 (% class="western" %) 155 155 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. 156 156 157 157 (% class="western" %) 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. 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. 159 159 160 160 (% class="western" %) 161 161 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. ... ... @@ -237,7 +237,25 @@ 237 237 Create a new users 238 238 239 239 (% class="western" %) 240 -Parameters required to create the user needs to be sent as post data in JSON format. 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 + 241 241 ))) 242 242 |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 243 243 ((( ... ... @@ -1151,7 +1151,7 @@ 1151 1151 )))|(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 1152 1152 ((( 1153 1153 (% class="western" %) 1154 -Users object that contains information about user to create. PartnerId Needs to be specified. 1171 +Users object that contains information about user to create. PartnerId Needs to be specified. PartnerId is any integer value. 1155 1155 ))) 1156 1156 |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 1157 1157 ((( ... ... @@ -1623,9 +1623,11 @@ 1623 1623 1624 1624 (% class="western" %) 1625 1625 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. 1626 1626 ))) 1627 1627 1628 - 1629 1629 (% id="HGETAllQuestions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 1630 1630 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Questions(%%) == 1631 1631 ... ... @@ -8139,8 +8139,9 @@ 8139 8139 (% id="HPUTUpdatequestion" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 8140 8140 == (% 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(%%) == 8141 8141 8142 ----- 8143 8143 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 + 8144 8144 {{panel bgColor="#D3D3D3" width="100%"}} 8145 8145 (% class="nolink" %)https:~/~/api.onecount.net/v2(% style="color:#212121" %)/questions/~{~{QUESTION ID}} 8146 8146 {{/panel}} ... ... @@ -8322,7 +8322,6 @@ 8322 8322 {"ProductID":"65","ResourceID":”121"} 8323 8323 ))) 8324 8324 8325 - 8326 8326 (% id="HGETAllProducts" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 8327 8327 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Products(%%) == 8328 8328 ... ... @@ -9076,7 +9076,6 @@ 9076 9076 JSON of the terms type object needs to be sent as post data. Id field is mandatory for update. 9077 9077 ))) 9078 9078 9079 - 9080 9080 (% id="HGETAllTerms" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 9081 9081 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Terms(%%) == 9082 9082 ... ... @@ -9682,7 +9682,6 @@ 9682 9682 JSON of the resources type object needs to be sent as post data. Id field is mandatory for update. 9683 9683 ))) 9684 9684 9685 - 9686 9686 (% id="HGETAllResources" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 9687 9687 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Resources(%%) == 9688 9688 ... ... @@ -10152,7 +10152,7 @@ 10152 10152 (% id="HCOMPONENT:SourceCodes" class="western" %) 10153 10153 === **COMPONENT: Source Codes** === 10154 10154 10155 -* 10172 +* 10156 10156 ** === 10157 10157 10158 10158 (% class="western" %) ... ... @@ -10225,7 +10225,6 @@ 10225 10225 JSON of the Sources type object needs to be sent as post data. Id field is mandatory for update. 10226 10226 ))) 10227 10227 10228 - 10229 10229 (% id="HGETAllSourcecodes" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 10230 10230 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Source codes(%%) == 10231 10231 ... ... @@ -10806,7 +10806,6 @@ 10806 10806 JSON of the Transactions type object needs to be sent as post data. Id field should not be sent. 10807 10807 ))) 10808 10808 10809 - 10810 10810 (% id="HGETAllTransactions" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 10811 10811 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Transactions(%%) == 10812 10812 ... ... @@ -12876,7 +12876,11 @@ 12876 12876 12877 12877 (% class="western" %) 12878 12878 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. 12879 12879 ))) 12898 +|(% style="text-align:left; vertical-align:top" %)POST|(% style="text-align:left; vertical-align:top" %) |(% style="text-align:left; vertical-align:top" %) 12880 12880 |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %) 12881 12881 ((( 12882 12882 (% class="western" %) ... ... @@ -12894,7 +12894,6 @@ 12894 12894 Parameters required to add user to the engagement needs to be sent as post data in JSON format. 12895 12895 ))) 12896 12896 12897 - 12898 12898 (% id="HGETAllEngagements" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 12899 12899 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Engagements(%%) == 12900 12900 ... ... @@ -13373,8 +13373,8 @@ 13373 13373 13374 13374 ---- 13375 13375 13376 -{{code language="yml" t heme="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":{}}13394 +{{code language="yml" title="Body"}} 13395 +{"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":{}} 13378 13378 {{/code}} 13379 13379 13380 13380 ==== Example ==== ... ... @@ -13383,7 +13383,7 @@ 13383 13383 13384 13384 (% style="color:#6b6b6b" %)Request 13385 13385 13386 -{{code language="php" t heme="RDark" title="Add User to Engagement Request"}}13404 +{{code language="php" title="Add User to Engagement Request"}} 13387 13387 <?php 13388 13388 13389 13389 $curl = curl_init(); ... ... @@ -13397,7 +13397,7 @@ 13397 13397 CURLOPT_FOLLOWLOCATION => true, 13398 13398 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 13399 13399 CURLOPT_CUSTOMREQUEST => 'POST', 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":{}}',13418 + 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":{}}', 13401 13401 CURLOPT_HTTPHEADER => array( 13402 13402 'Appkey: {{ONECOUNT API KEY}}' 13403 13403 ), ... ... @@ -13496,7 +13496,7 @@ 13496 13496 (% id="HCOMPONENT:Segments" class="western" %) 13497 13497 === **COMPONENT: Segments** === 13498 13498 13499 -* 13517 +* 13500 13500 ** === 13501 13501 13502 13502 (% class="western" %) ... ... @@ -13568,7 +13568,6 @@ 13568 13568 Get all segment user has be subscribed based on user id. 13569 13569 ))) 13570 13570 13571 - 13572 13572 (% id="HGETAllSegments" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %) 13573 13573 == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Segments(%%) == 13574 13574 ... ... @@ -13990,7 +13990,7 @@ 13990 13990 (% id="HCOMPONENT:Leads" class="western" %) 13991 13991 === **COMPONENT: Leads** === 13992 13992 13993 -* 14010 +* 13994 13994 ** === 13995 13995 13996 13996 (% class="western" %) ... ... @@ -14056,7 +14056,6 @@ 14056 14056 JSON of the Telemarketing type object needs to be sent as post data. Id field should not be sent. 14057 14057 ))) 14058 14058 14059 - 14060 14060 (% class="western" %) 14061 14061 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. 14062 14062 ... ... @@ -14171,7 +14171,6 @@ 14171 14171 Returns telemarketing ids of the newly created transaction. If multiple stats are sent, multiple ids are returned in cvs format. 14172 14172 ))) 14173 14173 14174 - 14175 14175 (% class="western" %) 14176 14176 **API REFERENCE** 14177 14177 ... ... @@ -14265,8 +14265,6 @@ 14265 14265 Alias for admin purpose. 14266 14266 ))) 14267 14267 14268 - 14269 - 14270 14270 (% class="western" %) 14271 14271 **Type: Choices** 14272 14272 ... ... @@ -14350,7 +14350,6 @@ 14350 14350 Tied to which question id. 14351 14351 ))) 14352 14352 14353 - 14354 14354 (% class="western" %) 14355 14355 **Type: Users** 14356 14356 ... ... @@ -14421,7 +14421,6 @@ 14421 14421 Request date. 14422 14422 ))) 14423 14423 14424 - 14425 14425 (% class="western" %) 14426 14426 **Type: Demo** 14427 14427 ... ... @@ -14479,7 +14479,6 @@ 14479 14479 ... 14480 14480 ))) 14481 14481 14482 - 14483 14483 (% class="western" %) 14484 14484 **Type: Transactions** 14485 14485 ... ... @@ -14667,7 +14667,6 @@ 14667 14667 If there is amount (USD) included in transaction. 14668 14668 ))) 14669 14669 14670 - 14671 14671 (% class="western" %) 14672 14672 **Type: Sources** 14673 14673 ... ... @@ -14738,7 +14738,6 @@ 14738 14738 If this is a child source then list the parent source id. 14739 14739 ))) 14740 14740 14741 - 14742 14742 (% class="western" %) 14743 14743 **Type: Products** 14744 14744 ... ... @@ -14809,7 +14809,6 @@ 14809 14809 (Array of) Terms associated with the product. 14810 14810 ))) 14811 14811 14812 - 14813 14813 (% class="western" %) 14814 14814 **Type: Terms** 14815 14815 ... ... @@ -14919,7 +14919,6 @@ 14919 14919 If there is price (USD) for the term. 14920 14920 ))) 14921 14921 14922 - 14923 14923 (% class="western" %) 14924 14924 **Type: Resources** 14925 14925 ... ... @@ -15063,7 +15063,6 @@ 15063 15063 Default value is 0. This parameter is used to provide access to protected content. 15064 15064 ))) 15065 15065 15066 - 15067 15067 (% class="western" %) 15068 15068 **Type: Telemarketing** 15069 15069 ... ... @@ -15179,5 +15179,3 @@ 15179 15179 (% class="western" %) 15180 15180 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. 15181 15181 ))) 15182 - 15183 -