jatin_sanghi
31st March 2022, 15:56
Hello,
I'm developing an API call to purchase freight labels for our shipments though a third party provider. I'm able to purchase labels and print them through curl.upload.string() using POST method, but if I need to void a label, I'm required to send an API request with DELETE method. The command works when I use it in tools like Postman etc, but ERPLn's curl command doesn't seem to be supporting the 'Delete' method.
DELETE https://api.channeladvisor.com/v1/Fulfillments(FulfillmentID)/Label?unshipfulfillment=true
Could you please help me out in finding how we can get this done in ERPLn.
Thanks,
Jatin
RieseUSA
1st April 2022, 01:41
Hi Jatin,
Could you possibly post the code? The provided URL by itself is not usable.
Yours,
Stephan
RieseUSA
1st April 2022, 02:05
Hi Jatin,
2nd thought:
The cURL functions are untrusted for cloud implementations, which is not your problem, and the http.* functions have been introduced as an recommended way to execute http requests.
The http.* functions include http.delete(), which is what you are trying to do The syntax is pretty simple so it might be worthwhile trying to use that function instead.
The http.* functions internally still execute the cURL ones. If there is an underlying problem there, you have a good reproduction to report to Infor support.
Heads up: The http.* functions had a bug (up to December 2021) that possibly caused a bshell core dump when they were used in the same process with the soap.* functions. This was resolved by corrections to the tools.
Yours,
Stephan
jatin_sanghi
1st April 2022, 18:37
Hello Stephan,
Thankyou for your input..I'm going to test these functions and see if they help. I'll keep the forum posted.
Thanks,
Jatin
jatin_sanghi
6th April 2022, 16:56
Hello Stephan,
We may not be able to use HTTP function currently in our system because our tools version is not supporting the TIV and related includes are not available.
We are planning to have a LN upgrade later this year and probably that time these function will be available.
We need to look out for some other way to handle this requirement for now.
Thanks,
Jatin
RieseUSA
6th April 2022, 17:12
Hi Jatin,
Could you please post your code as I had requested originally?
Yours,
Stephan
jatin_sanghi
22nd April 2022, 15:46
Stephan,
I was finally able to make it work using shell:
"curl -X DELETE " &
quoted.string("https://api.channeladvisor.com/v1/Fulfillments(1234567)/Label?unshipfulfillment=true") &
" -H " & quoted.string("accept: application/json") &
" -H " & quoted.string("Authorization: Bearer MCg9loyVJ4z1OyuF-*****")
I have attached the code that finally worked and the one that is commented out was not working.
Thanks,
Jatin
ee05220
25th July 2023, 20:35
I am trying to use curl to get API data, but according your example I am gettings this error "FATAL ERROR: PTY error: 'No more pty's available' (e=0)
Will be my version tools the error? Or syntax?
Here is the code
l.api.string = "curl -X GET "&
quoted.string(
"https://pp-ap.files.com/api/invoices")&
" -H ""ed.string("accept: application/json")&
" -H ""ed.string("Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyMyIsImp0aSI6ImZlMzMzMGU3OTg2OWQzMDhkYTM2YzYxMmFkM2VjMzY2ZTRiNGM0YjA2YTRiZ****")
Regards.