Build a Give Feedback HTTP Action

Build a Give Feedback HTTP Action

Let’s walk through a tutorial on building an action with Salesforce. In this case we will build the “Lookup Account By Name” action.

  1. Once in Agent Studio, navigate to “HTTP Actions”

  2. On the top right, click the “CREATE” button

  3. Since we are using a shared Workday Sandbox instance, the connector has already been set up for you. Choose “Inherit from existing connector” and select “Workday User Consent Auth”.

  4. After choosing this connector, on the top right next to "Test" you will see an "Import" icon button. Click that and you should see the following dialog. This allows you to easily import HTTP actions if you have a cURL command.

  5. Paste the following cURL command into the dialog and click "Import".

    curl --location 'https://impl-services1.wd12.myworkday.com/service/moveworks_dpt1/Talent/v42.1' \
    --header 'Content-Type: application/xml' \
    --data '<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:wsdl="urn:com.workday/bsvc" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
        <env:Header>
        </env:Header>
        <env:Body>
            <wsdl:Give_Feedback_Request>
                <wsdl:Give_Feedback_Data>
                    <wsdl:From_Worker_Reference>
                        <ID wsdl:type="WID">{{from_wid}}</ID>
                    </wsdl:From_Worker_Reference>
                    <wsdl:To_Workers_Reference>
                        <ID wsdl:type="WID">{{to_wid}}</ID>
                    </wsdl:To_Workers_Reference>
                    <wsdl:Comment>{{feedback_comment}}</wsdl:Comment>
                    <wsdl:Show_Name>true</wsdl:Show_Name>
                </wsdl:Give_Feedback_Data>
            </wsdl:Give_Feedback_Request>
        </env:Body>
    </env:Envelope>'
  6. You should see that all the fields you need for your API call have populated. Take a look at the body and notice the fields in curly brackets. These are the variables that will be populated as part of the API call. The way Workday integrations refer to users is by their "WID". This is a unique ID in Workday. Moveworks knows your WID as a result of it's User Import Process.

  7. Now navigate to “Input Args” - you should see that the from_wid, to_wid, and feedback_comment variables have been detected in the API call and they are of type “string” which is correct. In order to properly test that the action has been set up correctly, we can provide example values and test the call before publishing.

  8. Let's start with the from_wid. Click the pencil icon to open it up. In this example, the from_wid is you since you are the one giving the feedback. Let's look it up in the Developer Labs Moveworks bot. Ask the bot "what is my workday ID" or something similar.

  9. Copy that value and paste it into the "Example Value" field. This is the variable that will be passed into the XML and ultimately the API. Also ensure you provide a clear description - this is so that the reasoning engine understands what this is. Click "Required" and "Save".

  10. Now we must do the same for to_wid. This will be the WID of someone else that's also in this lab. If you have a lab neighbor, you can ask them for theirs! Otherwise you can use 6213655cca71100879b6d1c6c5ad0000. Remember to make sure you fill in the description and check the "Required" box and click"Save".

  11. Finally for feedback_comment, provide an example of whatever comment you'd like to say. Remember to make sure you fill in the description and check the "Required" box and click"Save".

  12. Since we are using "User Consent Auth" or Auth Code grant type, in order to test this we must authenticate to Workday and Allow Moveworks access. Make sure you are logged into Workday first. Click the TEST button and a "Generate New Access Token" dialog will pop up. Click "Generate New Access Token". A Workday interface should pop up. Click "Allow". You should see a screen that says "Callback Successful". If you note the URL, this is the callback URL indicating that Moveworks is using your user authentication token to make this call. You can close this screen.

  13. You will now see a "Connections" screen. This indicates all the systems you are connected to and can potentially connect to in order to allow users to authenticate or un-authenticate as they choose. You can close this screen and go back to your HTTP Action. You should now see that you have a token as indicated below at the bottom of the "Connections" tab.

  14. If the call was successful you should see a "200" Response code with some XML referencing the feedback transaction.

  15. Now we must name our HTTP Action. At the top, select the title bar to name your HTTP Action (see the note below before doing so). Your description can be anything that describes the Action such as “Give Feedback In Workday”
    IMPORTANT: Ensure you name the action in this format ”firstname_lastname_give_feedback”. This will ensure you know you are using YOUR action since there are many people at once doing the same exercise in this environment.

    On the top right, click the dropdown and choose “Validate”. This will ensure everything is correct before publishing. If everything checks out, choose “Publish”.