Skip to content

Trudeaucj/ConcurMHacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

What is Concur?

Concur is a travel and expense software solution that lets 25M business travelers book their travel, capture expense, submit expense reports, and more. Concur processes over 55 million transactions every year, representing $50 billion spend on T&E.

We are hiring!

Career Portal

What can I do with Concur APIs?

Check out the Developer Portal Check out the Swagger Page

The Travel/Itinerary API (v1.1) lets you access a Concur user's itinerary, including hotel/flight booking info. As an example, you can mash-up the Itinerary API with a restaurant database/API to provide recommendations of places to eat near a Concur user's hotel booking.

The Expense API (v3.0) allows you to get (and push) a Concur user's expense information, including expense line items, their types (e.g. food, lodging), totals, and even receipt images.

Here's an example on how to get an Itinerary List of a Concur user:

curl https://www.concursolutions.com/api/travel/trip/v1.1
-H "Authorization: OAuth <insert your access token here>"

To get an expense summary by using the Expense Report Digest API:

curl https://www.concursolutions.com/api/v3.0/expense/reportdigests
-H "Authorization: OAuth <insert your access token here>"
-H "Accept: application/json"

To get an access token (or learn how to generate one), please click here to advance to the section below.

You can interact with the API using Swagger here

For the Itinerary APIs (v1.1), full API documentation, and apps that use the APIs, please refer to:

https://developer.concur.com/get-started/webservices-overview

These are just example ideas from past external hackathons. We'd love for you to think beyond the ideas presented below :) Find other ideas here.

Challengepost lists Concur API integrations from previous hackathons. Definitely worth checking out! GitHub GreenGuest A team we sent to the 2015 AT&T Developer Summit who took home the M2X IoT Challenge prize!

The subsections below provide a more detailed information on how to:

  1. Get your Consumer Key

After logging in to http://concursolutions.com, go to Administration -> Register Partner Application -> Concur Partner Application (Modify). We need the consumer key so we can call the endpoint that would return the access token. (Note: Get your Concur login/password from Chris at the Concur booth or email him at [email protected])

  1. Call the access token request endpoint

Here's what the HTTP call looks like to request for an access token:

    GET https://www.concursolutions.com/net2/oauth2/accesstoken.ashx HTTP 1.1
    Authorization: Basic am9obl9kZXZlbG90bWFpbC5jb206VHJhdmVsJkV4cGVuc2UkMjAxMg==
    X-ConsumerKey: eZByXv2X41cJlC21pSVvRi    

Note that we already have X-ConsumerKey from number 1. To generate the Authorization: Basic value, you need to Base64-encode the login ID, colon and password such that [email protected]:Travel&Expense$2012 becomes am9obl9kZXZlbG90bWFpbC5jb206VHJhdmVsJkV4cGVuc2UkMjAxMg==. If you're not doing this programmatically yet, you can use this nifty web tool to generate that value (remember to choose Encode).

If you're using a Terminal, an equivalent curl statement of the above would be:

    curl https://www.concursolutions.com/net2/oauth2/accesstoken.ashx
    -H "Authorization: Basic am9obl9kZXZlbG90bWFpbC5jb206VHJhdmVsJkV4cGVuc2UkMjAxMg=="
    -H "X-ConsumerKey: eZByXv2X41cJlC21pSVvRi"

If the call is successful, you should get an XML response with a <Token> node. That's your access token. We recommend that you use Postman, a Chrome extension, to help you manage your API calls (not just Concur ones). Here's what the API calls look like in Postman:

  1. Call the APIs to pull expense report items

After getting an access token, we can pull dummy data from the Expense Report Digest, like so (in Terminal):

    curl https://www.concursolutions.com/api/v3.0/expense/reportdigests
    -H "Authorization: OAuth <insert your access token here>"

This would return an Expense Report response, with a field called ID. We need this ID to extract the expense line items we created in the app earlier. To liven things up a bit, let's use the Swagger documentation of the "Entries" API to get the individual expense line items:

We highlighted two things here, the (oval) field where you put in your access token, and the (rectangle) field where you put in the ID we got from the previous API call. Note that we can do this same call in curl, or in any fashion you want. Swagger just provides us a consolidated way to make the API calls.

To execute the call, click the "Try it out!" button. You should get a response like this below:

Note: The steps demonstrated above follow the OAuth Native Flow. If you prefer something similar to a Facebook login experience, you can check out the OAuth Web Flow here

Back to Top

  1. Pushing dummy data to Concur using the API
POST a dummy Itinerary to Concur:

      Request Type = POST
      Authorization = OAuth <your access token>
      URI = https://www.concursolutions.com/api/travel/trip/v1.1/
      ContentType = Application/XML
      Body = 
       <?xml version="1.0"?>
       <Itinerary xmlns="http://www.concursolutions.com/api/travel/trip/2010/06">
       <TripName>TechCrunch Disrupt Concur</TripName>
       <StartDateLocal>2015-10-30T03:47:14</StartDateLocal>
       <EndDateLocal>2015-11-06T03:47:14</EndDateLocal>
       <Bookings>
        <Booking>
         <Segments>
             <Hotel>
                 <Status>HK</Status>
                 <StartCityCode>SFO</StartCityCode>
                 <StartDateLocal>2015-10-30T07:47:14</StartDateLocal>
                 <EndDateLocal>2015-11-06T03:47:14</EndDateLocal>
                 <Name>Times Square Hilton New York</Name>
                 <RecordLocator>Hotel Locator</RecordLocator>
                 <RoomDescription>1 KING BED ACCESSIBLE ROOM - K1RRC</RoomDescription>
                 <Currency>USD</Currency>
                 <CancellationPolicy>Cxl 1 day prior to Arrival</CancellationPolicy>
                 <DailyRate>240.3500</DailyRate>
                 <NumRooms>1</NumRooms>
                 <NumPersons>1</NumPersons>
                 <RateCode>LV4</RateCode>
                 <Charges>
                     <Rate>
                         <Currency>USD</Currency>
                         <Amount>10.00</Amount>
                         <StartDatelocal>2015-10-30T07:47:14</StartDatelocal>
                         <IsPrimary>false</IsPrimary>
                         <SemanticsCode>ROOMRATE</SemanticsCode>
                         <PerUnit>DAY</PerUnit>
                         <NumUnits>3.00</NumUnits>
                     </Rate>
                 </Charges>
             </Hotel>
         </Segments>
         <RecordLocator>Disrupt123</RecordLocator>
         <BookingSource>Sample Itin for Disrupt</BookingSource>
         <DateBookedLocal>2015-10-30T03:47:14</DateBookedLocal>
       </Booking>
       <Booking>
         <Segments>
             <Air>
                 <Vendor>AA</Vendor>
                 <FlightNumber>425</FlightNumber>
                 <StartCityCode>SFO</StartCityCode>
                 <StartDateLocal>2015-10-30T03:47:14</StartDateLocal>
                 <EndCityCode>NYC</EndCityCode>
                 <EndDateLocal>2015-11-30T07:47:14</EndDateLocal>
                 <Cabin>O</Cabin>
                 <ClassOfService>O</ClassOfService>
             </Air>
         </Segments>
         <RecordLocator>Air Locator</RecordLocator>
         <BookingSource>Sample Itin for Disrupt</BookingSource>
         <DateBookedLocal>2015-08-30T03:47:14</DateBookedLocal>
       </Booking>
     </Bookings>
     </Itinerary>

**Hack tip :** More details on the Itinerary API v1.1. [here](https://developer.concur.com/itinerary-tmc-and-third-party-developers/itinerary-resource/itinerary-resource-get)
     
POST Expense Report Header to Concur: 

     Request Type = POST
     Authorization = OAuth <your access token>
     URI = https://www.concursolutions.com/api/v3.0/expense/reports
     ContentType = Application/JSON
     Accept = Application/JSON
     Body = 
     {
          "Name": "Disrupt Hackathon NYC Trip",
          "Purpose": "All Hackathon Expenses",
          "Comment": "Includes hotel and meals.",
          "OrgUnit1": "US",
          "OrgUnit3": "Bellevue",
          "Custom1": "Client",
          "Custom2": "Local",
          "UserDefinedDate": "2015-11-01 15:15:07.0"
      }
**Hack tip 1:** You can POST using JSON by setting the header to `Content-Type:application/json` and checking out a sample JSON body in our [Swagger](https://www.concursolutions.com/api/docs/index.html#!/Reports) doc.  Note that the examples here use v1.1, and those shown in Swagger use v3.0.

**Hack tip 2**: You need to generate a report header to be able to submit an expense entry.  A collection of entries is a report.
    
*Click [here](https://developer.concur.com/api-documentation/web-services/expense-report) to view the relationship of an Expense Report Header to an Expense Report Entry and search for **Expense Report Processes**.   *

GET Expense Report Details:

     Request Type = GET
     Authorization = OAuth <your access token>
     URI = https://www.concursolutions.com/api/v3.0/expense/reports
     ContentType = Application/JSON

GET Expense Group Configuration

     Request Type = GET
     Authorization = OAuth <your access token>
     URI = https://www.concursolutions.com/api/v3.0/expense/expensegroupconfigurations
     Accept = Application/JSON

POSTing Expense Report Entry:

     Request Type = POST
     Authorization = OAuth <your access token>
     URI = https://www.concursolutions.com/api/v3.0/expense/entries
     ContentType = Application/JSON
     Accept = Application/JSON
     Body = 
     {
        "ExpenseTypeCode": "BRKFT",
        "PaymentTypeID":"<PAYMENT TYPE ID FROM EXPENSE GROUP CONFIGURATION",
        "ReportID": "<REPORT ID FROM GET EXPENSE REPORT DETAILS/POST EXPENSE REPORT>",
        "TransactionAmount": "3.50",
        "TransactionCurrencyCode": "USD",
        "TransactionDate": "2015-08-31",
        "VendorDescription": "Starbucks"
      }
  1. Pushing dummy expense data to Concur using the app

You can access the web version of Concur at http://concursolutions.com/ or get the mobile app from App Store or Google Play.

You can view/add new expenses (and even add a receipt image!) to have a variety of data to pull for your API calls. After adding expenses, you can create a report to associate it with by tapping the "Add to Report" button (in the last screenshot above).

Back to Top

All app integrations with Concur can be found in the App Center. Below are just two examples that would hopefully give you an idea on what to build:

  • Challengepost lists Concur API integrations from previous hackathons. Definitely worth checking out!

  • TravelText - TravelText allows you to text your expenses right into Concur. No more paper receipts and Excel sheet mayhem! Check out their video demo here.

  • Trover - it's travel photography + business travel integration in one great app. Quoting from this article, what they get for integrating with Concur is "being able to tap into Concur’s experience, knowledge and “great visibility into travel patterns”".

Back to Top

About

Get started and readme for @concur @mhacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published