This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Receipt Images in Concur



Overview

The following operations allow you to work with receipt images. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with receipt images, see Sample configuration.

OperationDescription

createReceiptImage

Creates a new image.

getReceiptIdsForUserGets a list of all receipt IDs.
deleteReceiptImageDeletes a receipt image.
getReceiptImageURLGets a receipt image URL.

Operation details

This section provides details on each of the operations.

 Creating a new image

The createReceiptImage operation allows you to create a new image in the receipt store. This operation does not require init to be called. The apiUrl and user parameters should be used as query parameters of the ESB request URL. The image data file should be sent in the body of the request. Authorization and Content-Type should also be sent as headers, e.g., Authorization = "OAuth"+" "+ "token", Content-Type = "image/gif"

createReceiptImage
<concur.createReceiptImage>
	<user>{$url:user}</user>
    <apiUrl>{$url:apiUrl}</apiUrl>
</concur.createReceiptImage>
Properties
  • user: Optional - The login ID of the user. The access token owner must have the Web Services Admin (Professional) or Can Administer (Standard) user role to use this parameter.
  • apiUrl: URL of the concur API.
Sample request

Following is a sample REST/XML request that can be handled by the createReceiptImage operation.

Sample Request for createReceiptImage
http://localhost:8280/services/concur_createNewReceiptImage?apiUrl=https://www.concursolutions.com&user=user@gmail.com
Related Concur documentation

https://www.concursolutions.com/api/docs/index.html#!/ReceiptImages/Post_user_post_2

 Retrieving receipt IDs

The getReceiptIdsForUser operation gets a list of all receipt IDs owned by the user associated with the OAuth token.

getReceiptIdsForUser
<concur.getReceiptIdsForUser>
	<offset>{$ctx:offset}</offset>
    <limit>{$ctx:limit}</limit>
    <user>{$ctx:user}</user>
</concur.getReceiptIdsForUser>
Properties
  • offset: Starting page offset.
  • limit: Number of objects to be returned (default is 25).
  • user: Optional - The login ID of the user. The access token owner must have the Web Services Admin (Professional) or Can Administer (Standard) user role to use this parameter. 
Sample request

Following is a sample REST/XML request that can be handled by the getReceiptIdsForUser operation.

Sample Request for getReceiptIdsForUser
<getReceiptIdsForUser>
	<apiUrl>https://www.concursolutions.com</apiUrl>
	<accessToken>IpilFdfFn1pElj3wfuW6NUlkeQu1o=</accessToken>
	<contentType>application/xml</contentType>
	<offset>4</offset>	
	<limit>2</limit>	
	<user>user@gmail.com</user> 
</getReceiptIdsForUser>
Related Concur documentation

https://www.concursolutions.com/api/docs/index.html#!/ReceiptImages/Get_offset_limit_user_get_0

 Deleting a receipt image

The deleteReceiptImage operation deletes the specified receipt image.

deleteReceiptImage
<concur.deleteReceiptImage>
	<id>{$ctx:id}</id>
    <user>{$ctx:user}</user>
</concur.deleteReceiptImage>
Properties
  • id: Required - ID of the receipt image to be deleted.
  • user: Optional - The login ID of the user. The access token owner must have the Web Services Admin (Professional) or Can Administer (Standard) user role to use this parameter.
Sample request

Following is a sample REST/XML request that can be handled by the deleteReceiptImage operation.

Sample Request for deleteReceiptImage
<deleteReceiptImage>
	<apiUrl>https://www.concursolutions.com</apiUrl>
	<accessToken>IpilFFn1pdfElj3wfuW6NUlkeQu1o=</accessToken>
	<contentType>application/xml</contentType>
	<id>nQKNNSwbk2PtnsKwSw$sfNqDLMtCCm8tvjE1Y7HFARGthJS1vPgw1c2wphJ5AsSH7gB</id>
	<user>user@gmail.com</user> 
</deleteReceiptImage>
Related Concur documentation

https://www.concursolutions.com/api/docs/index.html#!/ReceiptImages/Delete_id_user_delete_4

 Retrieving a receipt image URL

The getReceiptImageURL operation gets a receipt image URL by image ID.

getReceiptImageURL
<concur.getReceiptImageURL>
	<id>{$ctx:id}</id>
    <user>{$ctx:user}</user>
</concur.getReceiptImageURL>
Properties
  • id: Required - ID of the receipt image.
  • user: Optional - The login ID of the user. The access token owner must have the Web Services Admin (Professional) or Can Administer (Standard) user role to use this parameter.
Sample request

Following is a sample REST/XML request that can be handled by the getReceiptImageURL operation.

Sample Request for getReceiptImageURL
<getReceiptImageURL>
	<apiUrl>https://www.concursolutions.com</apiUrl>
	<accessToken>IpilFFndf1pElj3wfuW6NUlkeQu1o=</accessToken>
	<contentType>application/json</contentType>
	<id>nQKNNSwbk2PtnsKwSw$sNqDLMtCCm8tvjE1Y7HFARGthJS1vPgw1c2wphJ5AsSH7gB</id>
	<user>user@gmail.com</user> 
</getReceiptImageURL>
Related Concur documentation

https://www.concursolutions.com/api/docs/index.html#!/ReceiptImages/Get_id_user_get_1

Sample configuration

Following is a sample proxy service that illustrates how to connect to Concur with the init operation and use the getReceiptIdsForUser operation. The sample request for this proxy can be found in getReceiptIdsForUser sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="concur_getReceiptIdsForUser"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl" expression="//apiUrl/text()"/>
         <property name="accessToken" expression="//accessToken/text()"/>
         <property name="contentType" expression="//contentType/text()"/>
         <property name="offset" expression="//offset/text()"/>
         <property name="limit" expression="//limit/text()"/>
         <property name="user" expression="//user/text()"/>
         <concur.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <accessToken>{$ctx:accessToken}</accessToken>
            <contentType>{$ctx:contentType}</contentType>
         </concur.init>
         <concur.getReceiptIdsForUser>
            <offset>{$ctx:offset}</offset>
            <limit>{$ctx:limit}</limit>
            <user>{$ctx:user}</user>
         </concur.getReceiptIdsForUser>
         <filter xpath="get-property('contentType') != 'application/json'">
            <then>
               <property name="uri.var.errorMessage" expression="json-eval($.Error.Message)"/>
            </then>
            <else>
               <property name="uri.var.errorMessage" expression="json-eval($.Message)"/>
            </else>
         </filter>
         <filter source="$axis2:HTTP_SC" regex="^[^2][0-9][0-9]">
            <then>
               <switch source="$axis2:HTTP_SC">
                  <case regex="400">
                     <property name="ERROR_CODE" value="600400"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </case>
                  <case regex="401">
                     <property name="ERROR_CODE" value="600401"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </case>
                  <case regex="404">
                     <property name="ERROR_CODE" value="600404"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </case>
                  <case regex="403">
                     <property name="ERROR_CODE" value="600403"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </case>
                  <case regex="400">
                     <property name="ERROR_CODE" value="600400"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </case>
                  <case regex="500">
                     <property name="ERROR_CODE" value="600500"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </case>
                  <default>
                     <property name="ERROR_CODE" expression="$axis2:HTTP_SC"/>
                     <property name="ERROR_MESSAGE" expression="get-property('uri.var.errorMessage')"/>
                  </default>
               </switch>
               <sequence key="faultHandlerSeq"/>
            </then>
         </filter>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>