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

From version 11.1
edited by Rayaan Ahmed
on 2024/02/29 16:10
Change comment: There is no comment for this version
To version 8.2
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  (((
... ... @@ -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,149 +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" title="(% class=~"documentation-core-item-request-name jbmEtY sc-fzomuh~" style=~"color:#212121~" %)Add options to metric"}}
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 - "text":"checks",
13474 - "value":"checks"
13475 - },
13476 - {
13477 - "text":"c",
13478 - "value":"c"
13479 - }
13480 - ]
13481 - },
13482 - {
13483 - "Name": "Price",
13484 - "Type": "text"
13485 - },
13486 - {
13487 - "Name": "Name",
13488 - "Type": "select",
13489 - "Values": [
13490 - {
13491 - "text": "Webinar 1",
13492 - "value": "Webinar_1"
13493 - },
13494 - {
13495 - "text": "Webinar 2",
13496 - "value": "Webinar_2"
13497 - }
13498 - ]
13499 - },
13500 - {
13501 - "Name": "Transaction Date",
13502 - "Type": "text"
13503 - },
13504 - {
13505 - "Name": "id",
13506 - "Type": "text"
13507 - },
13508 - {
13509 - "Name": "activity_time",
13510 - "Type": "text"
13511 - }
13512 - ]
13513 - }
13514 - ]
13515 -}
13516 -{{/code}}
13517 -
13518 -
13519 -
13520 -
13521 -
13522 -
13523 13523  (% id="HPOSTAddUsertoEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13524 13524  == (% 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(%%) ==
13525 13525  
... ... @@ -13539,8 +13539,8 @@
13539 13539  
13540 13540  ----
13541 13541  
13542 -{{code language="yml" title="Body"}}
13543 -{"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":{}}
13544 13544  {{/code}}
13545 13545  
13546 13546  ==== Example ====
... ... @@ -13549,7 +13549,7 @@
13549 13549  
13550 13550  (% style="color:#6b6b6b" %)Request
13551 13551  
13552 -{{code language="php" title="Add User to Engagement Request"}}
13386 +{{code language="php" theme="RDark" title="Add User to Engagement Request"}}
13553 13553   <?php
13554 13554  
13555 13555  $curl = curl_init();
... ... @@ -13563,7 +13563,7 @@
13563 13563   CURLOPT_FOLLOWLOCATION => true,
13564 13564   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13565 13565   CURLOPT_CUSTOMREQUEST => 'POST',
13566 - 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":{}}',
13567 13567   CURLOPT_HTTPHEADER => array(
13568 13568   'Appkey: {{ONECOUNT API KEY}}'
13569 13569   ),
... ... @@ -13734,6 +13734,7 @@
13734 13734  Get all segment user has be subscribed based on user id.
13735 13735  )))
13736 13736  
13571 +
13737 13737  (% id="HGETAllSegments" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13738 13738  == (% class="imuBmi sc-fzoaKM" style="color:#007f31" %)GET (% class="documentation-core-item-request-name jbmEtY sc-fzomuh" style="color:#212121" %)All Segments(%%) ==
13739 13739  
... ... @@ -14221,6 +14221,7 @@
14221 14221  JSON of the Telemarketing type object needs to be sent as post data. Id field should not be sent.
14222 14222  )))
14223 14223  
14059 +
14224 14224  (% class="western" %)
14225 14225  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.
14226 14226  
... ... @@ -14335,6 +14335,7 @@
14335 14335  Returns telemarketing ids of the newly created transaction. If multiple stats are sent, multiple ids are returned in cvs format.
14336 14336  )))
14337 14337  
14174 +
14338 14338  (% class="western" %)
14339 14339  **API REFERENCE**
14340 14340  
... ... @@ -14428,6 +14428,8 @@
14428 14428  Alias for admin purpose.
14429 14429  )))
14430 14430  
14268 +
14269 +
14431 14431  (% class="western" %)
14432 14432  **Type: Choices**
14433 14433  
... ... @@ -14511,6 +14511,7 @@
14511 14511  Tied to which question id.
14512 14512  )))
14513 14513  
14353 +
14514 14514  (% class="western" %)
14515 14515  **Type: Users**
14516 14516  
... ... @@ -14581,6 +14581,7 @@
14581 14581  Request date.
14582 14582  )))
14583 14583  
14424 +
14584 14584  (% class="western" %)
14585 14585  **Type: Demo**
14586 14586  
... ... @@ -14638,6 +14638,7 @@
14638 14638  ...
14639 14639  )))
14640 14640  
14482 +
14641 14641  (% class="western" %)
14642 14642  **Type: Transactions**
14643 14643  
... ... @@ -14825,6 +14825,7 @@
14825 14825  If there is amount (USD) included in transaction.
14826 14826  )))
14827 14827  
14670 +
14828 14828  (% class="western" %)
14829 14829  **Type: Sources**
14830 14830  
... ... @@ -14895,6 +14895,7 @@
14895 14895  If this is a child source then list the parent source id.
14896 14896  )))
14897 14897  
14741 +
14898 14898  (% class="western" %)
14899 14899  **Type: Products**
14900 14900  
... ... @@ -14965,6 +14965,7 @@
14965 14965  (Array of) Terms associated with the product.
14966 14966  )))
14967 14967  
14812 +
14968 14968  (% class="western" %)
14969 14969  **Type: Terms**
14970 14970  
... ... @@ -15074,6 +15074,7 @@
15074 15074  If there is price (USD) for the term.
15075 15075  )))
15076 15076  
14922 +
15077 15077  (% class="western" %)
15078 15078  **Type: Resources**
15079 15079  
... ... @@ -15217,6 +15217,7 @@
15217 15217  Default value is 0. This parameter is used to provide access to protected content.
15218 15218  )))
15219 15219  
15066 +
15220 15220  (% class="western" %)
15221 15221  **Type: Telemarketing**
15222 15222  
... ... @@ -15332,3 +15332,5 @@
15332 15332  (% class="western" %)
15333 15333  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.
15334 15334  )))
15182 +
15183 +