Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
50%
Handover everything to System Integrator from drawing BP till implementation of ERP
0%
Hire more inhouse skilled & capable IT Resource to work directly with SI
50%
Rely on SI Architects/Consultants
0%
Total votes: 2

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 18th May 2020, 15:04
Rishabh Rishabh is offline
Newbie
 
Join Date: Jan 2019
Posts: 2
Rishabh is on a distinguished road
Baan: B40c - DB: oracle - OS: aix
How to call APIs from Infor Ln? What is the use of curl functionality?

How to call APIs from Infor Ln?
What is the use of curl functionality in Infor Ln?
Reply With Quote
  #2  
Old 18th May 2020, 18:15
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,444
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Yes. You can use curl functions to call your REST API's.

e.g. curl.download.data() can be used to perform a GET request.

Sample -

Code:
long ret
long response
string respones.data(1024)

ret  = curl.download.data("https://reqres.in/api/users/2",response.data,response)
|* response.data should now contain the JSON string for ID=2.

Similarly, you can perform POST request using curl.upload.data() or curl.upload.string(). I don't have sample with me, but probably, you will need to set headers for that. Play around with it and you will find a way.

Additionally, for SOAP webservice API's you can use soap.* functions provided by LN. And, for HTTP API's you can use http.* functions.

Also, you can write a JAVA/Python program to do all the API calling stuff and call those programs from LN using run.prog().

There are many ways, you just need to do decide how you would want to do it.

Hope that helps!
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #3  
Old 18th May 2020, 18:32
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,444
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Okay, so I did a quick try and here's the code for POST request -

Code:
   

   string data(4 * 1024) | 4 Kb long data.size
   long response
   string response.data(128)

|* Building my JSON string
   data = "{" & chr$(34) & "name" & chr$(34) & ":"  & chr$(34) & "Bhushan" & chr$(34) & "," &
                chr$(34) & "job" & chr$(34) & ":"  & chr$(34) & "IT" & chr$(34) & "}"

  |# Open a JSON file to write the response
   response = seq.open("E:\temp\mynewtest.json","w+")
  
 |# Do a POST Request
   ret = curl.upload.string("https://reqres.in/api/users", trim$(data), response)

|# Close the file and it should contain the JSON response
   seq.close(response)
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #4  
Old 19th May 2020, 08:19
Rishabh Rishabh is offline
Newbie
 
Join Date: Jan 2019
Posts: 2
Rishabh is on a distinguished road
Baan: B40c - DB: oracle - OS: aix
How to call APIs from Infor Ln? What is the use of curl functionality in Infor Ln?

Thanks Bhushan for quick help.

We will check/try and will let you know if further help is needed.
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Message " Call Center" not found in the Call (tsclm110m000) session Call(s puneet Project & Services 1 2nd June 2015 12:37
Maintain Replenishment Orders pedromrs AFS/DDC/OLE: Function servers 11 13th January 2007 08:32


All times are GMT +2. The time now is 23:58.


©2001-2018 - Baanboard.com - Baanforums.com