Nav

SAP Concur Connector

Select

SAP Concur is a SaaS provider from SAP for integrated travel and expense management solutions.

Anypoint Connector for Concur operates as a bi-directional gateway between instances of Concur and Mule. It is a closed-source connector that supports SOAP and REST calls to various Concur APIs.

Prerequisites

This document assumes that you are familiar with Mule, Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.

You need login credentials to test your connection to your target resource.

For hardware and software requirements and compatibility information, see the Connector Release Notes.

To use this connector with Maven, view the pom.xml dependency information in the Dependency Snippets in Anypoint Exchange.

To Connect in Design Center

  1. Click a trigger. You can create a global element by selecting Reusable Configurations. If a global element is not needed, you can use an HTTP Listener or Scheduler trigger.

    Trigger options

  2. To create an HTTP global element for the connector, set these fields:

    Http Listener configuration

    Field Description

    Protocol

    Protocol selected for the HTTP endpoint, it can be HTTP or HTTPS (secure).

    Host

    IP address where your Mule application listens for requests.

    Port

    Port address where your Mule application listens for requests.

    Base

    Path where your Mule application listens for requests.

  3. Select the plus sign to add a component.

    add connector

  4. Select the connector as a component.

  5. Select an operation (see the next section for a list of operations).

  6. Configure the Global element for the connector.

    config connector

    Field Description

    Host

    Enter the host name of the Concur connector.

    Port

    Enter the port on which the Concur connector is running. Default value is 443.

    Base Path

    Path where your Mule application listens for requests.

    Protocol

    Protocol selected for the http endpoint, it can be http or https (secure).

    Authorization

    A Concur access token.

  7. Create an access token for your Concur instance by specifying https://www.concursolutions.com:443/net2/oauth2/accesstoken.ashx in Postman with the GET method.

  8. Configure Basic Auth with your username and password.

    Postman basic auth setup

  9. Configure the X-ConsumerKey with your Consumer Key in the Concur headers.

    Postman Concur header configuration

    The following returns from Concur:

    
                
             
    1
    2
    3
    4
    5
    6
    
     <Access_Token>
        <Instance_Url>https://www.concursolutions.com/</Instance_Url>
        <Token>0_PijEv7CuZl+123123123=</Token>
        <Expiration_date>2/28/2019 11:34:51 PM</Expiration_date>
        <Refresh_Token>0_HlvMXvXod6LsK123123123123123=</Refresh_Token>
    </Access_Token>
  10. Put the token in the SAP Concur connector configuration, for example:

    Oauth 0_PijEv7CuZl+123123123=

About Concur API Availability

Review the SAP Concur Connector Reference for the supported API.

Connect in Anypoint Studio 7

You can use this connector in Anypoint Studio by adding it as a dependency in your Mule application.

Install Connector in Studio

  1. Open your Mule project in Anypoint Studio.

  2. Add the connector as a dependency in the pom.xml file:

    
                 
              
    1
    2
    3
    4
    5
    6
    
    <dependency>
      <groupId>org.mule.modules</groupId>
      <artifactId>mule-module-concur</artifactId>
      <version>4.0.3</version>
      <classifier>mule-plugin</classifier>
    </dependency>

Example Use Case

This guide presents two of many use cases you might have for the Concur connector in your organization: getting a list of lists and retrieving quickexpenses. You may jump ahead and paste the code for the flows into the XML Editor in Studio after you download the Concur connector and create a global element to reference your Concur instance credentials.

Retrieve a List of Lists

After creating a new project and a Concur global element:

  1. Add a new flow element by dragging it from the palette and give a name to the flow, such as getlists.

  2. Drag an HTTP Listener into your flow from the palette.

  3. Double-click the HTTP Listener and click the green plus sign next to the Connector Configuration dropdown and set the Host to localhost, and the Port to 8081.

  4. Click OK to close the properties window, then enter getlists as the value in the Path field in this HTTP listener’s Basic Settings section.

  5. Add a Concur connector to the new flow and select the Get list of lists operation, after selecting the Connector Configuration you desire.

  6. Finally, add a Transform Message transformer to the flow.

  7. For reference you may check the particular getlists flow within the example XML code further down.

To execute the flow and check the outcome:

  1. Right-click the project in the Package Explorer, and click Run As > Mule Application.

  2. Check that the application has started by monitoring the Studio console.

  3. Open browser and go to http://localhost:8081/getlist

  4. You should receive a JSON response like this:

    
                 
              
    1
    2
    3
    
    {"list":[{"batchLink":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GsRt9CeqUjOAfZXRTmGyyVczqg/batch","id":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GsRt9CeqUjOAfZXRTmGyyVczqg","isVendor":false,"itemsLink":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GsRt9CeqUjOAfZXRTmGyyVczqg/items","levels":1,"name":"AT Tax Form List 1"},
    {"batchLink":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GsRsUIXmIbg3iUc6qE9AlKEVxA/batch","id":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GsRsUIXmIbg3iUc6qE9AlKEVxA","isVendor":false,"itemsLink":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GsRsUIXmIbg3iUc6qE9AlKEVxA/items","levels":1,"name":"BE Tax Form List 1"},
    {"batchLink":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GscWDPncbQqGUoCjCv4pxrnp2A/batch","id":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GscWDPncbQqGUoCjCv4pxrnp2A","isVendor":false,"itemsLink":"https://www.concursolutions.com/api/expense/list/v1.0/gWqXO46r6GscWDPncbQqGUoCjCv4pxrnp2A/items","levels":1,"name":"CH Tax Form List 1"}
  5. Click the stop button to halt the server running the application.

Create a Quick Expense

  1. Add a new flow element by dragging it from the palette and name it getquickexpenses.

  2. Add an HTTP Listener to your flow by dragging it from the palette.

  3. Use the configuration from the first demo, or if you did not create that flow, click the green plus sign next to Connector Configuration for the HTTP endpoint and enter localhost as the Host and 8081 for the Port.

  4. Click OK to close the properties window, then enter getquickexpenses as the value in the Path field in this HTTP listener’s Basic Settings section.

  5. Add the Concur connector to the new flow, referencing a global element from the Connector Configuration and set an Operation to perform and any other properties you require.

  6. Finally, add an Transform Message transformer link in the previous example.

To execute the flow and check the outcome, perform the following steps:

  1. Right-click the project in the Package Explorer > Run As > Mule Application

  2. Check the console to see when the application starts.

  3. Open the browser and go to http://localhost:8081/getquickexpenses

  4. You should receive a JSON response like this:

    
                 
              
    1
    2
    
    {"items":{"quickExpense":[{"comment":"","currencyCode":"USD","expenseTypeCode":"UNDEF","expenseTypeName":"Undefined","id":"gWr7TiTHdIi5fyWCPBRPtqjeCIWyv2w","locationName":"","ownerLoginID":"","ownerName":"Unknown","paymentTypeCode":"PENDC","receiptImageID":"","transactionAmount":111.0,"transactionDate":"2018-07-21T00:00:00","uri":"https://www.concursolutions.com/api/v3.0/expense/quickexpenses/gWr7TiTHdIi5fyWCPBRPtqjeCIWyv2w","vendorDescription":""},
    {"comment":"","currencyCode":"USD","expenseTypeCode":"UNDEF","expenseTypeName":"Undefined","id":"gWr7TiTXbQ47PtJ$pVkr6CzbLeRVRPww","locationName":"","ownerLoginID":"","ownerName":"Unknown","paymentTypeCode":"PENDC","receiptImageID":"","transactionAmount":111.0,"transactionDate":"2018-07-21T00:00:00","uri":"https://www.concursolutions.com/api/v3.0/expense/quickexpenses/gWr7TiTXbQ47PtJ$pVkr6CzbLeRVRPww","vendorDescription":""},
  5. Click the stop button to halt the server running the application.