API-Based Integrations
- You initiate the integration and deliver the payload by API calls from an application to Integration Hub but not by way of the user interface.
- The payload can vary according to the source.
- Integration Hub can be configured to transform or map the incoming or outgoing data.
- Primarily, you use this type of process for transactional updates from source applications.
API-based integrations
- Are not available in the Integrations grid or list views.
- Cannot access cross-reference tables.
- Expose a REST end point. The end point is asynchronous and returns an identifier (ID) which aids monitoring of the process status from another API.
- Are synchronous so that failures are detected early and status is updated immediately even if the integration has failures or is blocked.
- You cannot use Transaction Assistant to resubmit failed API integrations.
- Because API-based integrations bypass Integration Hub, you do not need to configure a GDAP or an SFTP server.
Validations:
- Validity of the API integration key
- Validity of user-provided parameters
- Presence of user-prompted parameters
- Install the API-based integration
(Optional) If not already done, install or "deploy" API-based integration packs to make them available as integration templates for running or scheduling.
- Kliknij Dotknij Main Menu
> Administration > Application Setup > Integrations Setup > Install Integrations. - Kliknij Dotknij Create
. Enter a unique Integration Name. - Select API Integration.
- Select the integration template from the table. Kliknij Dotknij Assign
. - Add, edit, or delete parameters
Parameters or external files are required or optional when you run or schedule an integration. Parameters vary by integration and can include settings for licenses, to disqualify active or inactive employees, for seniority date, pay period for a location, or job status.
- Create, edit, or remove a parameter.
- Kliknij Dotknij Create
. Enter a Parameter Name. Tip: Use camel case for parameter names. Example: DisqualifyTerminated.
- Select a parameter. Kliknij Dotknij Edit
. - Select a parameter. Kliknij Dotknij Delete
. Kliknij Dotknij Yes to confirm.
- Kliknij Dotknij Create
- Select a Template Parameter to be the source of the parameter.
- Select the Parameter Type to define the data format of the parameter:
- Boolean — Select True or False, On or Off, or Yes or No.
- Text
- Password
- Time Period — Select a time range.
- Number — Requires a numeric entry.
- Date — Select a date.
- Hyperfind Wyszukiwarka, która filtruje i wybiera grupy pracowników przy użyciu zapytań określających warunki lub lokalizacje (kryteria). query — Select groups of employees.
- Enter a Default Value.
- Select User Prompted so that this parameter prompts when the user must enter or select a value.
- Kliknij Dotknij Save.
- Repeat for more parameters.
- Create, edit, or remove a parameter.
- Kliknij Dotknij Save.
- Repeat for more API-based integration packs.
- Kliknij Dotknij Main Menu
- Copy the API integration key
The API integration key is generated when you install an API integration, and is needed only for API integration REST API calls. In contrast, the API key calls all external REST APIs from the HTTP request header.
- Do one of the following:
- Kliknij Dotknij Main Menu
> Maintenance > Integrations. In the list, search for API integrations. - Submit an API call.
- Kliknij Dotknij Main Menu
- Copy the Near Real Time API Key.
- Do one of the following:
- Run the integration from an application
Example: Postman
- Select POST or GET.
- Paste the API integration key into the URI as a parameter after /execute/.
Przestroga :When you paste the key, it may include a trailing space. Delete that space. Otherwise, the key will not link to the URI.
Example: POST: http://{host}/wfc/restcall/v1/ihub/integrations/real_time/execute/{APIIntegrationKey}
- Select Send.
- When the integration completes, check Response for details, the status, and any errors.
- Log in to verify that the integration ran.
Get the list and details of all installed API integrations
GET
URL: http://<host>:<port>/v1/ihub/integrations/real_time
Response-
[
{
"name": "integration_1",
"description": "sample_integration",
"nearRealTimeApiKey": "r-337428fa-229e-4c7c-a4b7-3d878da8efe2-3",
"parameters": [
{
"name": "param1",
"description": "value1"
},
{
"name": "param2",
"description": "value2"
},
...
...
]
},
...
...
]
Get details of an installed API integration
GET
URL: http://<host>:<port>/v1/ihub/integrations/real_time/<uniqueId>
Response-
[
{
"name": "integration_1",
"description": "sample_integration",
"nearRealTimeApiKey": "r-337428fa-229e-4c7c-a4b7-3d878da8efe2-3",
"parameters": [
{
"name": "param1",
"description": "value1"
},
{
"name": "param2",
"description": "value2"
},
...
...
]
Run an integration
POST
URL: http://<host>:<port>/v1/ihub/integrations/real_time/execute/<uniqueId>
Request data
Response contains executionId
Poll the status of an integration run
GET
URL: http://<host:port>/v1/ihub/integrations/real_time/<executionId>/status
Response contains the status
parameters = The list of user-prompted properties that you configure when you install an integration.
data = The employee fields to import.
{
"parameters":[
{
"name": "DisqualifyInactive",
"value": "true"
},
{
"name": "DisqualifyTerminated",
"value": "true"
},
],
"data": [
{
"name": "EmployeeID",
"value": "899172"
},
"name": "EmailID",
"value": "first.lastname@domain.com"
},
...
{
"name": "EmploymentStatus",
"value": "Active"
}
]
}
{
"id": "8d98117b-5d78-e6ec-6f7d-385a89d8a7ef",
"name": "API integration",
"description": "",
"order": [
"c36d07f4-4e02-6ce9-301f-c1d07cf0d873",
"dbcf3d77-016e-faf9-f3c7-2678115d52f9"
],
"folders": [],
"timestamp": 1479357830283,
"owner": 0,
"public": false,
"requests": [
{
"id": "c36d07f4-4e02-6ce9-301f-c1d07cf0d873",
"headers": "Content-Type: application/json\n",
"url": "http://{{host}}/wfc/restcall/v1/ihub/integrations/real_time/execute/r-253fd076-8285-4ce1-a3f7-b400488d1e1f-1?tenantId=healthcare",
"preRequestScript": null,
"pathVariables": {},
"method": "POST",
"data": [],
"dataMode": "raw",
"version": 2,
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"time": 1481888949875,
"name": "API integration punch import sample",
"description": "",
"collectionId": "8d98117b-5d78-e6ec-6f7d-385a89d8a7ef",
"responses": [],
"rawModeData": "{\r\n \"parameters\": [\r\n {\r\n \"name\": \"batchName\",\r\n \"value\": \"Punch Import\"\r\n },\r\n {\r\n \"name\": \"RunSinglePunch\",\r\n \"value\": \"true\"\r\n },\r\n {\r\n \"name\": \"enableTransactionAssistant\",\r\n \"value\": \"false\"\r\n },\r\n {\r\n \"name\": \"UpdateExistingPunches\",\r\n \"value\": \"false\"\r\n }\r\n ],\r\n \"data\": [\r\n {\r\n \"name\": \"Employee\",\r\n \"value\": \"20008\"\r\n },\r\n {\r\n \"name\": \"Date\",\r\n \"value\": \"12/18/2016\"\r\n },\r\n {\r\n \"name\": \"Time\",\r\n \"value\": \"10:30:00\"\r\n },\r\n {\r\n \"name\": \"OverrideType\",\r\n \"value\": \"2\"\r\n }\r\n ]\r\n}"
},
{
"id": "dbcf3d77-016e-faf9-f3c7-2678115d52f9",
"headers": "",
"url": "http://{{host}}/wfc/restcall/v1/ihub/integrations/real_time/7/status?tenantId=healthcare",
"preRequestScript": null,
"pathVariables": {},
"method": "GET",
"data": null,
"dataMode": "params",
"tests": null,
"currentHelper": "normal",
"helperAttributes": {},
"time": 1481870725958,
"name": "Fetch status",
"description": "",
"collectionId": "8d98117b-5d78-e6ec-6f7d-385a89d8a7ef",
"responses": []
}
]
}