I was hoping someone could help with setting up IFS Connect to send time registration to a 3rd party api.
I have created a test custom event where new or changed time registration information is submitted to IFS. My 3rd part company has an API for create time sheet eg https://api.company.com/createtimesheet . So I need to send the API key and respective time-sheet data from IFS. I am just ensure of the routing address/application message setup part. Would appreciate some screen shots of working example if possible
Page 1 / 1
Have you considered creating a PL/SQL package to send the data to the RESTful timesheet web API and avoid using IFS Connect? This would be easier to troubleshoot and debug.
Cwright,
What version of IFS are you running?
We have recently upgraded to IFS v9.
I do not have the greatest of expertise when it comes to building PL/SQL packages and want to avoid using external consultancy for help with that, so IFS connect seemed like the obvious choice.
Hi @cwright ,
Apps 9 built in HTTP sender is capable of sending HTTP POST with headers. Is this OK with your API? It would be nice to know what kind of input your API expects.
Hi @cwright ,
Apps 9 built in HTTP sender is capable of sending HTTP POST with headers. Is this OK with your API? It would be nice to know what kind of input your API expects.
@dsj thanks yes i think so, but I was hoping for a working example with screenshots, is that anything you could share?
Hi @cwright ,
Here’s a simple example on how to route event response to IFS Connect
1. Event: Fires when any change to Description field
2. Event Action:
Type = Application message
3. Create New Outbound Routing Rule
Route From: APPLICATION_MESSAGE
Queue: NOTIFICATIONS
Routing Condition: MESSAGE_FUNCTION = TEVENT_ID]
Routing Address : In this example I use File Connector.
Output XML for this example looks like this
Note that it contains the Fields we selected in the Event
What you have to do
Create a Routing Address of type HTTP to send to your API
Create a transformer if necessary.
Cheers!
Hi all,
I am copying this process exactly in IFS 10 but when I try to carry out the action that triggers the event (i.e. changing the status of a Shop Order), I get the error shown below (“Element denoted by path h$EVENT_RECORD$] not found”). If I disable the Event Action, I can change the Shop Order successfully. Any ideas?
Many thanks, Ged.
Hi Ged,
Please make sure you have included the required new/old fields in the event header.
Alternatively you can use plsql to generate the XML in the required format if you need values not available on that table.
Hi @cwright ,
Here’s a simple example on how to route event response to IFS Connect
1. Event: Fires when any change to Description field
2. Event Action:
Type = Application message
3. Create New Outbound Routing Rule
Route From: APPLICATION_MESSAGE
Queue: NOTIFICATIONS
Routing Condition: MESSAGE_FUNCTION = CEVENT_ID]
Routing Address : In this example I use File Connector.
Output XML for this example looks like this
Note that it contains the Fields we selected in the Event
What you have to do
Create a Routing Address of type HTTP to send to your API
Create a transformer if necessary.
Cheers!
@dsj
I have been able to start implementing and testing this. I am having to use an XML to JSON transformer which seems to work when I output to a file and review the contents. However what I am struggling to do is include additional parameters as I need to send an APIKey and an action with the post . I have tried using the additional headers but that doesn’t seem to work.
Can you anyone help?
Do you mean something like this?
Custom attributes can be added which use variables from the main attributes list. We use them to add requisitioner details to the purchase order released event...
@GPIE
I tried to use custom attributes but they only accept IFS PL/SQL APIs with parameter fields from the IFS Database. I need to insert a ‘hard-coded’ API key supplied by a 3rd party to send with the post to the 3rd Party’s API.
@GPIE
I tried to use custom attributes but they only accept IFS PL/SQL APIs with parameter fields from the IFS Database. I need to insert a ‘hard-coded’ API key supplied by a 3rd party to send with the post to the 3rd Party’s API.
Hi @cwright ,
I’m not sure why the additional headers properties does not work. Can you show how you set it up?
However, if you need to add a static value in the XML, there are several ways.
One way is to add a public custom field in a common window and access it via generated get method.
Otherwise, I usually use Conversion List in data migration basic data to store common static values.
@dsj Thanks for that information, do you have any recommendations for handling column names, eg my API is expecting employeeId and the application message includes NEW_EMP_NO, also the application message includes fields I don’t want , anyway to exclude them?
Use a transformer to push the message out as required
Use a transformer to push the message out as required
I also agree with @Mike.Hollifield , with a transformer you can change the field names, exclude unnecessary tags and put into any structure you need.