You can authenticate with Concur to create your own instance of the Concur element through Cloud Elements or through APIs. Once authenticated, you can use the element instance to access the different functionality offered by the Concur platform.
Use Cloud Elements to authenticate with Concur and create an element instance.
After successfully authenticating, we give you several options for next steps. Make requests using the API docs associated with the instance, map the instance to a virtual data resource, or use it in a formula template.
Authenticating through API is a multi-step process that involves:
Use the following API call to request a redirect URL where the user can authenticate with the vendor. Replace {keyOrId}
with the element key, concur
.
GET /elements/{keyOrId}/oauth/url?apiKey=<api_key>&apiSecret=<api_secret>&callbackUrl=<url>&siteAddress=<url>
Query Parameter | Description |
---|---|
apiKey | The key obtained from registering your app with the provider. This is the Client ID that you recorded in API Provider Setup section. |
apiSecret | The client secret obtained from registering your app with the provider. This is the Client Secret that you recorded in API Provider Setup section. |
callbackUrl | The URL that will receive the code from the vendor to be used to create an element instance. This is the Callback URL that you recorded in API Provider Setup section. |
curl -X GET
-H 'Content-Type: application/json'
'https://api.cloud-elements.com/elements/api-v2/elements/concur/oauth/url?apiKey=fake_api_key&apiSecret=fake_api_secret&callbackUrl=https://www.mycoolapp.com'
Use the oauthUrl
in the response to allow users to authenticate with the vendor.
{
"element": "concur",
"oauthUrl": "https://www.concursolutions.com/net2/oauth2/Login.aspx?scope=LIST%2CCONFIG%2CATTEND%2CERECPT%2CEXPRPT%2CTRVPRF%2CTRVREQ%2CUSER%2CTWS&response_type=code&redirect_uri=https%3A%2F%2Fhttpbin.org%2Fget&state=concur&client_id=UPjRvqOyYz9hDdWLLLLuQV"
}
Provide the response from the previous step to the users. After they authenticate, Concur Beta provides the following information in the response:
Response Parameter | Description |
---|---|
code | The Authorization Grant Code required by Cloud Elements to retrieve the OAuth access and refresh tokens from the endpoint. |
state | A customizable identifier, typically the element key (concur ) . |
error
instead of the code
parameter. In this case, your application can handle the error gracefully.Use the /instances
endpoint to authenticate with Concur Beta and create an element instance. If you are configuring events, see the Events section.
To create an element instance:
Construct a JSON body as shown below (see Parameters):
{
"element": {
"key": "concur"
},
"providerData": {
"code": "<AUTHORIZATION_GRANT_CODE>"
},
"configuration": {
"oauth.api.key": "<CONCUR_KEY>",
"oauth.api.secret": "<CONCUR_SECRET>",
"oauth.callback.url": "<CALLBACK_URL>"
},
"tags": [
"<Add_Your_Tag>"
],
"name": "<INSTANCE_NAME>"
}
Call the following, including the JSON body you constructed in the previous step:
POST /instances
Locate the token
in the response and save it for all future requests using the element instance.
curl -X POST \
https://api.cloud-elements.com/elements/api-v2/instances \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
"element": {
"key": "concur"
},
"providerData": {
"code": "0_mG9HpbmXfGi3gIQHlWNUbnHP0aOlN"
},
"configuration": {
"oauth.api.key":"UPjRvqOyYz9hDdWLLLLuQV",
"oauth.api.secret":"GNnU6D7uvWMjOyOEsU7uL1Xc4iaEdEOa",
"oauth.callback.url":"https://mycoolapp.com" },
"tags": [
"Test"
],
"name": "ConcurInstance"
}'
API parameters are in code formatting
.
Heading | Heading | Data Type |
---|---|---|
'key' | The element key. concur |
string |
Namename |
The name for the element instance created during authentication. | Body |
OAuth API Keyoauth.api.key |
The Key from Concur. | string |
OAuth API Secretoauth.api.secret |
The Secret from Concur. | string |
Filter null values from the response filter.response.nulls |
Optional. Determines if null values in the response JSON should be filtered from the response. Yes or true indicates that Cloud Elements will filter null values. Default: true . |
boolean |
Events Enabled event.notification.enabled |
Optional. Identifies that events are enabled for the element instance.Default: false . |
boolean |
Event Type event.vendor.type |
Optional. identifies the type of events enabled for the instance. The Concur Beta element supports only polling . |
string |
Event Notification Callback URLevent.notification.callback.url |
Where do you want CE to send the events that we generate?. | string |
Callback Notification Signature Key event.notification.signature.key |
Optional. A user-defined key for added security to show that events have not been tampered with. | string |
Event poller refresh interval (mins)event.poller.refresh_interval |
A number in minutes to identify how often the poller should check for changes. | number |
Configure Polling "event.poller.configuration" |
||
reports"event.poller.configuration": "{"reports"...}" (see Events) |
OptionalThe Concur reports . resource available for polling. |
JSON object |
tags | Optional. User-defined tags to further identify the instance. | string |