I'd like to take information from a submitted form and pass it to an Orchestration using the REST api. I have examples of how to do this in Excel, but the data is coming from a submitted LF form. Any suggestions as to how I might do this?
I'd like to take information from a submitted form and pass it to an Orchestration using the REST api. I have examples of how to do this in Excel, but the data is coming from a submitted LF form. Any suggestions as to how I might do this?
Here's an example:
It's multiple parts. And it seems like every API does the authentication a little different (just have to troubleshoot and read their documentation really carefully).
This particular system requires me to do different POST calls to get a token and ID that is needed for each additional call after that:
Workflow has several built-in activies that can work with APIs. I've never worked specifically with Oracle, but I've accessed APIs from within Workflow to our ticketing system (BossDesk), the tracking/reporting system used by one of our security vendors (Sophos), and our Core (core is credit union speak for "account system").
It's not as powerful as coding a direct solution to the API (which I've also done with those same APIs and also DocuSign's API) but it's easier to implement.
Since Workflow can work with and manipulate the data submitted in the form, you should be able to handle it to the API from within Workflow.
@████████: thanks for the reply. I suspected I might need to use Workflow. I've gone through the activities available in WF and the only one that seemed relevant is the Script activity. I know enough about vb.net, having written lots of VBA code in Excel and Access, that I think I could write a routine that uses the Excel example I mentioned earlier as an outline of sorts. Or, did you have a different WF activity in mind?
The activities in Workflow are "HTTP Form Post" and "HTTP Web Request".
Edit: and you'll likely need the "Read JSON" token to work with the returned data.
Ok, I will look into those more closely. I haven't used either one before, so I might be grasping at straws. I'll check Answers to see if there are any examples, but if you have examples I would appreciate it! Thanks.
Here's an example:
It's multiple parts. And it seems like every API does the authentication a little different (just have to troubleshoot and read their documentation really carefully).
This particular system requires me to do different POST calls to get a token and ID that is needed for each additional call after that:
Matthew,
I apologize for the delay in my reply. I have a couple of questions:
I don't think I need to send a request to the api for an authorization code; that appears to be already set up, at least according to my Oracle administrator. So, I basically need to pass the authorization code (dummy example below), the body (which includes field names and values from the forms process), and get back the ResponseText which should validate that a record was created via the API call.
An example of what this looks like when we run the API call from a SQL Server stored procedure is below (@URL is the URL to our Oracle server's API). I'm looking to get the ResponseText in my LF Workflow in order to trigger another Forms process that needs the info from the API call.
:
EXEC sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
EXEC sp_OAMethod @Object, 'open', NULL, 'post', @URL, 'false'
EXEC sp_OAMethod @Object, 'setRequestHeader', null, 'Content-Type', 'application/json'
EXEC sp_OAMethod @Object, 'setRequestHeader', null, 'Authorization', 'Basic zzz123abc456yyyyxxx9876'
EXEC sp_OAMethod @Object, 'setRequestHeader', null, 'environment', 'JDV920'
EXEC sp_OAMethod @Object, 'setRequestHeader', null, 'role', '*All'
EXEC sp_OAMethod @Object, 'send', null, @body
EXEC sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
EXEC sp_OADestroy @Object
@████████ - hoping you have a moment to look at my last reply. Thank you very much!
The Host (configured from Web Service) and URI (set in the activity in Forms) fields combined are the URL that is being accessed for the API.
Let's say for example that your API is called via URLs like this:
https://www.fakesite.com/api/tenant/lookup
Then you'd likely want to set your Host as https://www.fakesite.com and the URI as /api/tenant/lookup.
The EXEC commands you listed don't seem to include the URL (the second one just lists @URL), so I can't speculate what you need to list for those values.
Four of the EXEC commands that you listed are header values - which Workflow does in the "Request Headers" section. Look at my screenshot #3 - what I have listed there for authorization via a Bearer token, should be equivalent to the 4th EXEC command you have that is setting Basic authorization with a token. You would set the Authorization header to be "Basic zzz123abc456yyyyxxx9876". You should be able to set-up all four parts of the header that are shown in your EXEC commands 3-6.
Thanks for the clarification. The URL being passed for the @URL parameter is http://xxx.com:9184/jderest/orchestrator/TA_FA_AP02_ORC_MatchPO (I replaced the host name with xxx), so it sounds like the host is http://xxx.com:9184 and the URI would be /jderest/orchestrator/TA_FA_AP02_ORC_MatchPO?
Yes, I believe so.
I can't set up the host using the domain I was given; it just returns a 404 error so I'll have to follow up with my E1 support team and possibly my VAR in order to go any further. I appreciate your information and I'll accept one of your replies as the answer. Thanks.
Yeah, unfortunately, this part requires an awful lot of tweaking and testing to get right.