You can authenticate with Orderful to create your own instance of the Orderful element through the UI or through APIs. Once authenticated, you can use the element instance to access the different functionalities offered by the platform.
Authenticate Through the UI
Use the UI to authenticate with Orderful and create an element instance as described in Authenticate an Element Instance (UI). In addition to the instance name, you will need the Orderful API key as identified in Orderful API Provider Setup.
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.
Authenticate Through API
Authenticating through API is as simple as providing the necessary authentication parameters in the request body in order to Authenticate the element instance.
Authenticating the Element Instance
Use the /instances
endpoint to authenticate with Orderful and create an element instance. If you are configuring events, see the Orderful Events documentation.
To create an element instance:
Construct a JSON body as shown below (see Parameters):
{
"element": {
"key": "orderful"
},
"configuration": {
"event.vendor.type": "polling",
"event.poller.refresh_interval": "15",
"event.notification.enabled": "false",
"event.poller.configuration": "{\"transactions\":{\"url\":\"/hubs/edi/transactions?where=dateFrom='${gmtDate:yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}'\",\"idField\":\"id\",\"datesConfiguration\":{\"updatedDateField\":\"latestRevisionAt\",\"updatedDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\",\"updatedDateTimezone\":\"GMT\",\"createdDateField\":\"createdAt\",\"createdDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\",\"createdDateTimezone\":\"GMT\"}}}",
"orderful.api.key": "ODiblY1Zok6MTrbcuvsEM49iIKkPPhD1qfb7kuJ8"
},
"name": "<INSTANCE_NAME>"
}
Call the following, including the JSON body you constructed in the previous step:
POST /instances
Locate the
token
andid
in the response and save them for all future requests using the element instance.
Example cURL
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
'{
"name": "<INSTANCE_NAME>",
"configuration": {
"orderful.api.key": "ODiblY1Zok6MTrbcuvsEM49iIKkPPhD1qfb7kuJ8"
}
}'
Parameters
API parameters not shown in Cloud Elements are in code formatting
.
Parameter | Description | Data Type |
---|---|---|
Keykey | The element key. orderful | string |
Namename | The name for the element instance created during authentication. | Body |
Configured Application Nameapp.name | The Configured Application Name that you noted in API Provider Setup | string |
Host Name/IPhost.ip | The Host Name/IP that you noted in API Provider Setup. | 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 Cloud Elements will filter null values.Default: true . | boolean |
tags | Optional. User-defined tags to further identify the instance. | string |
Example Response
{
"id": 6932,
"name": "Orderful",
"key": "orderful",
"description": "Add an Orderful instance to connect your existing Orderful account to the EDI Hub allowing you to create transactions for trading with Orderful. You will need an Orderful API Key to add an instance",
"image": "https://images.cloudelements.io/orderful201811131702.png",
"logo": "orderful",
"active": true,
"deleted": false,
"typeOauth": false,
"trialAccount": false,
"configuration": {
"id": 99550,
"name": "Orderful API Key",
"key": "orderful.api.key",
"description": "API Key provided from Orderful ",
"resellerConfig": false,
"companyConfig": false,
"active": true,
"internal": false,
"groupControl": false,
"displayOrder": 1,
"type": "TEXTFIELD_64",
"hideFromConsole": false,
"required": true
},...
"resources":[...] ,
"objects": [...],
"models": [...],
"transformationsEnabled": true,
"bulkDownloadEnabled": false,
"bulkUploadEnabled": false,
"cloneable": true,
"extendable": true,
"beta": false,
"authentication": ,
"hooks": [...],
"extended": false,
"useModelsForMetadata": true,
"hub": "edi",
"protocolType": "http",
"parameters": [...],
"private": false
}