You can authenticate with Coupa to create your own instance of the Coupa connector through the UI or through APIs. Once authenticated, you can use the connector instance to access the different functionalities offered by the Coupa platform.
Authenticate Through the UI
Use the UI to authenticate with Coupa and create a connector instance as described in Authenticate a Connector Instance (UI). In addition to the base authentication parameters, you will need the credentials that you identified in the API Provider Setup article.
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 common resource, or use it in a formula template.
Authenticate Through API
Authenticating through API is as simple as providing the necessary authentication parameters in the request body in order to provision an instance.
Authenticating the Connector Instance
Use the /instances
endpoint to authenticate with Coupa and create a connector instance. If you are configuring events, see the Events
section.
To create a connector instance:
Construct a JSON body as shown below (see Parameters):
{ "element": { "key": "coupa" }, "configuration": { "filter.response.nulls": "true", "api.key": "<API_KEY>", "siteAddress": "<SITEADDRESS>" }, "tags": [ "<Add_Your_Tag>" ], "name": "<INSTANCE_NAME>" }
Call the following, including the JSON body you constructed in the previous step:
POST /instances
Note: Make sure that you include the User and Organization keys in the header. For more information, see Authorization Headers, Organization Secret, and User Secret.Locate the
token
andid
in the response and save them for all future requests using the connector instance.
Example cURL
curl -X POST \
https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/instances \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
"element": {
"key": "coupa"
},
"configuration": {
"filter.response.nulls": "true",
"api.key": "<API_KEY>",
"siteAddress": "<SITEADDRESS>"
},
"tags": [
"Coupa"
],
"name": "INSTANCE_NAME"
}'
Parameters
API parameters not shown in SAP Open Connectors are in code formatting
.
Parameter | Description | Data Type |
---|---|---|
Keykey | The connector key. coupa | string |
Namename | The name for the connector instance created during authentication. | Body |
Configured Application Nameapi.key | The API Key that you recorded in the API Provider Setup article. | string |
Site AddresssiteAddress | The site address for Coupa - https://cloudelements-coupalink-demo.coupacloud.com/ | string |
Filter null values from the responsefilter.response.nulls | Optional. Determines if null values in the response JSON should be filtered from the response. Yes or true indicates that SAP Open Connectors will filter null values.Default: true . | boolean |
tags | Optional. User-defined tags to further identify the instance. | string |
Example Response
{
"id": 123456,
"name": "<Instance_name>",
"createdDate": "2020-01-15T10:36:40Z",
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"elementId": 12345,
"tags": [...],
"valid": true,
"disabled": false,
"maxCacheSize": 0,
"cacheTimeToLive": 0,
"configuration": {
"base.url": "https://{siteAddress}/api/",
"event.notification.subscription.id": null,
"default.select.fields.map": null,
"event.notification.basic.username": null,
"pagination.max": "50",
"event.notification.basic.password": "********",
"siteAddress": "xxxxxxxxxxxxxxxxxxxxx",
"event.vendor.type": "polling",
"filter.response.nulls": "true",
"api.key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"event.notification.instance.finder": null,
"pagination.type": "offset",
"event.poller.refresh_interval": "15",
"event.notification.callback.url": null,
"event.notification.signature.key": null,
"authentication.time": null,
"event.poller.configuration":{...},
"event.notification.enabled": "false"
},
"authenticationType": "custom",
"eventsEnabled": false,
"cachingEnabled": false,
"traceLoggingEnabled": false,
"organizationId": 1234,
"accountId": 12345,
"externalAuthentication": "none",
"userId": 123456,
"element": {
"id": 12345,
"name": "Coupa",
"hookName": "Coupa",
"key": "coupa",
"description": "Add a Coupa Instance to connect your existing Coupa account to the Business Spend Management Hub, allowing you to manage requisitions/orders, approvals, invoices, payments conforming to a procure to pay scenario. You will need to create Coupa Apikey from application to use it for instance creation.",
"image": "elements/custom-element-default-logo.png",
"logo": "coupa",
"active": true,
"deleted": false,
"typeOauth": false,
"trialAccount": false,
"resources":[...]
},
"user": {
"id": 12345
}
}