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

From version 10.3
edited by Rayaan Ahmed
on 2024/02/29 15:56
Change comment: (Autosaved)
To version 10.5
edited by Rayaan Ahmed
on 2024/02/29 16:06
Change comment: (Autosaved)

Summary

Details

Page properties
Content
... ... @@ -10169,7 +10169,7 @@
10169 10169  (% id="HCOMPONENT:SourceCodes" class="western" %)
10170 10170  === **COMPONENT: Source Codes** ===
10171 10171  
10172 -*
10172 +*
10173 10173  ** ===
10174 10174  
10175 10175  (% class="western" %)
... ... @@ -12899,7 +12899,7 @@
12899 12899  Add options to specific metric in an engagement without passing all options and overriding existing options.
12900 12900  
12901 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. If any metric does not exist
12902 +\\This API is used to add options only for select and checkbox metrics.
12903 12903  )))
12904 12904  |(% style="text-align:left; vertical-align:top" %)(% style="text-align: left;vertical-align: top;" %)
12905 12905  (((
... ... @@ -13377,6 +13377,141 @@
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 +
13380 13380  (% id="HPOSTAddUsertoEngagement" style="margin-left: 0.0px;" class="sc-fznLPX cxTVKx" %)
13381 13381  == (% 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(%%) ==
13382 13382  
... ... @@ -13519,7 +13519,7 @@
13519 13519  (% id="HCOMPONENT:Segments" class="western" %)
13520 13520  === **COMPONENT: Segments** ===
13521 13521  
13522 -*
13657 +*
13523 13523  ** ===
13524 13524  
13525 13525  (% class="western" %)
... ... @@ -14012,7 +14012,7 @@
14012 14012  (% id="HCOMPONENT:Leads" class="western" %)
14013 14013  === **COMPONENT: Leads** ===
14014 14014  
14015 -*
14150 +*
14016 14016  ** ===
14017 14017  
14018 14018  (% class="western" %)