---
category: [Homepages & Self-Service Sites, Platform and Product Extensions, Platform and Product Extensions/Home Experience, Administration & Integrations, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Orchestration, Orchestration Builder]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Example: Get And Create Peakon Data
layout: subsection
---

### Scenario

<a id="context_N10045_N10042_N10001"></a>
If the employee is a manager, you want to retrieve and create these Peakon data values:

-   Peakon ID.
-   Segment ID.
-   Engagement score status.


### Steps

1.  <a id="step_N10098_N10050_N10042_N10001"></a>From the <b>Components</b> panel, drag <b>Send HTTP Request</b> and drop it in the <b>IF</b> flow. Select the <b>Send HTTP Request</b> component you just dropped and:
    1.  Double-click <b>SendHTTPRequest</b> to rename the step to <i>Get Manager ID</i>.
    2.  On the <b>Properties</b> panel, enter a <b>Reference Name</b> of <i>getManagerID</i>.
    3.  Click <b>Edit Properties</b>.

2.  <a id="step_N100C6_N10050_N10042_N10001"></a>Enter these values.
    1.  On the `GET` request row, click the <b>+</b> icon and enter `https://api.peakon.com/scim/v2/Users?filter=externalId%20eq%20%22`.
    2.  Click the <b>+</b> icon and select <b>Data from Orchestration Steps</b> &gt; <b>CREATE VALUES</b> &gt; <b>workerID</b>.
    3.  Click the <b>+</b> icon and enter <i>%22</i>.
    4.  On the <b>Authentication</b> tab, select <b>peakonAPI</b> as the <b>Authentication Type</b>.
    5.  On the <b>Settings</b> tab, select <b>Json</b> as the <b>Response Type</b>.
    6.  Click <b>Save Changes</b>, then click <b>Close</b>.

3.  <a id="step_N10130_N1005E_N10042_N10001"></a>From the <b>Components</b> panel, drag <b>Create Values</b> and drop it below <b>Send HTTP Request</b> in the <b>IF</b> flow. Select the <b>Create Values</b> component you just dropped and:
    1.  Double-click <b>CreateValues</b> to rename the step to <i>Create Manager ID</i>.
    2.  On the <b>Properties</b> panel, enter a <b>Reference Name</b> of <i>createManagerID</i>.
    3.  Click <b>Edit Properties</b>.

4.  <a id="step_N1016E_N1005E_N10042_N10001"></a>Enter these values:

<table><thead></thead><tbody><tr><td><b>Type</b></td><td>String</td></tr><tr><td><b>Key</b></td><td><i>managerID</i></td></tr><tr><td><b>Value</b></td><td><ul><li>    Click the <b>+</b> icon and select <b>Data from Orchestration Steps</b> &gt; <b>SEND HTTP REQUEST getManagerID</b> &gt; <b>response</b>.
</li><li>    Hover over <b>getManagerID.response</b>, click the <b>fx</b> icon, and select <b>stringAtJsonPath</b>.
</li><li>    Click the <b>+</b> icon inside the <b>stringAtJsonPath</b> function and enter <code>$.Resources[0].id</code>.
</li><li>    Hover over <b>stringAtJsonPath</b>, click the <b>fx</b> icon, and select <b>remove</b>.
</li><li>    Click the <b>+</b> icon inside the <b>remove</b> function and enter <i>employee_</i>.
</li></ul></td></tr></tbody></table><br/>

5.  <a id="step_N10212_N1005E_N10042_N10001"></a>Click <b>Save Changes</b>, then click <b>Close</b>.
6.  <a id="step_N1022F_N1005E_N10042_N10001"></a>From the <b>Components</b> panel, drag <b>Send HTTP Request</b> and drop it below the <b>CREATE VALUES</b> component in the <b>IF</b> flow. Select the <b>Send HTTP Request</b> component you just dropped and:
    1.  Double-click <b>SendHTTPRequest</b> to rename the step to <i>Get Segment ID</i>.
    2.  On the <b>Properties</b> panel, enter a <b>Reference Name</b> of <i>getSegmentID</i>.
    3.  Click <b>Edit Properties</b>.

7.  <a id="step_N1026D_N1005E_N10042_N10001"></a>Enter these values.
    1.  On the `GET` request row, click the <b>+</b> icon and enter `https://api.peakon.com/v1/segments?filter[type]=employee&filter[direct]=true&filter[managerId]=`.
    2.  Click the <b>+</b> icon and select <b>Data from Orchestration Steps</b> &gt; <b>CREATE VALUES createManagerID</b> &gt; <b>managerID</b>.
    3.  On the <b>Authentication</b> tab, select <b>peakonAPI</b> as the <b>Authentication Type</b>.
    4.  On the <b>Settings</b> tab, select <b>Json</b> as the <b>Response Type</b>.
    5.  Click <b>Save Changes</b>, then click <b>Close</b>.

8.  <a id="step_N102EA_N1005E_N10042_N10001"></a>From the <b>Components</b> panel, drag <b>Create Values</b> and drop it below the second <b>SEND HTTP REQUEST</b> in the <b>IF</b> flow. Select the <b>Create Values</b> component you just dropped and:
    1.  Double-click <b>CreateValues</b> to rename the step to <i>Create Segment ID</i>.
    2.  On the <b>Properties</b> panel, enter a <b>Reference Name</b> of <i>createSegmentID</i>.

9.  <a id="step_N10328_N1005E_N10042_N10001"></a>Click <b>Edit Properties</b> to set up the component.
    1.  Enter these values:

<table><thead></thead><tbody><tr><td><b>Type</b></td><td>String</td></tr><tr><td><b>Key</b></td><td><i>segmentID</i></td></tr><tr><td><b>Value</b></td><td><ul><li>        Click the <b>+</b> icon and select <b>Data from Orchestration Steps</b> &gt; <b>SEND HTTP REQUEST getSegmentID</b> &gt; <b>response</b>.
</li><li>        Hover over <b>getSegmentID.response</b>, click the <b>fx</b> icon, and select <b>stringAtJsonPath</b>.
</li><li>        Click the <b>+</b> icon inside the <b>stringAtJsonPath</b> function and enter <code>$.data[0].attributes.contextId</code>.
</li></ul></td></tr></tbody></table><br/>

    2.  Click <b>Save Changes</b>, then click <b>Close</b>.

10. <a id="step_N103C9_N1005E_N10042_N10001"></a>From the <b>Components</b> panel, drag <b>Send HTTP Request</b> and drop it below the second <b>CREATE VALUES</b> component in the <b>IF</b> flow. Select the <b>Send HTTP Request</b> component you just dropped and:
    1.  Double-click <b>SendHTTPRequest</b> to rename the step to <i>Get Engagement Status</i>.
    2.  On the <b>Properties</b> panel, enter a <b>Reference Name</b> of <i>getEngagementStatus</i>.
    3.  Click <b>Edit Properties</b>.

11. <a id="step_N10407_N1005E_N10042_N10001"></a>Enter these values.
    1.  On the `GET` request row, click the <b>+</b> icon and enter `https://api.peakon.com/v1/engagement/contexts/`.
    2.  Click the <b>+</b> icon and select <b>Data from Orchestration Steps</b> &gt; <b>CREATE VALUES createSegmentID</b> &gt; <b>segmentID</b>.
    3.  Click the <b>+</b> icon and enter `/overview?interval=recent`.
    4.  On the <b>Authentication</b> tab, select <b>peakonAPI</b> as the <b>Authentication Type</b>.
    5.  On the <b>Settings</b> tab, select <b>Json</b> as the <b>Response Type</b>.
    6.  Click <b>Save Changes</b>, then click <b>Close</b>.

12. <a id="step_N10493_N1005E_N10042_N10001"></a>From the <b>Components</b> panel, drag <b>Create Values</b> and drop it below the third <b>SEND HTTP REQUEST</b> in the <b>IF</b> flow. Select the <b>Create Values</b> component you just dropped and:
    1.  Double-click <b>CreateValues</b> to rename the step to <i>Create Engagement Status</i>.
    2.  On the <b>Properties</b> panel, enter a <b>Reference Name</b> of <i>createEngagementStatus</i>.
    3.  Click <b>Edit Properties</b>.

13. <a id="step_N104D1_N1005E_N10042_N10001"></a>Enter these values:

<table><thead></thead><tbody><tr><td><b>Type</b></td><td>String</td></tr><tr><td><b>Key</b></td><td><i>engagementStatus</i></td></tr><tr><td><b>Value</b></td><td><ul><li>    Click the <b>+</b> icon and select <b>Data from Orchestration Steps</b> &gt; <b>SEND HTTP REQUEST getEngagementStatus</b> &gt; <b>response</b>.
</li><li>    Hover over <b>getEngagementStatus.response</b>, click the <b>fx</b> icon, and select <b>stringAtJsonPath</b>.
</li><li>    Click the <b>+</b> icon inside the <b>stringAtJsonPath</b> function and enter <code>$.data.attributes.scores.status</code>.
</li></ul></td></tr></tbody></table><br/>

14. <a id="step_N1054B_N1005E_N10042_N10001"></a>Click <b>Save Changes</b>, then click <b>Close</b>.


### Result

<a id="result_N10567_N10042_N10001"></a>
You can now access Peakon employee data in subsequent components in the orchestration.

### Next Steps

<a id="postreq_N10570_N10042_N10001"></a>
See [Example: Branch On Engagement Score Status](/wcp_docs/tle1630014572668.html).

