External API Call with POST Method and File Upload - with ABAP [english]
Вставка
- Опубліковано 13 тра 2023
- In today's video I will show you how to call an external API from SAP.
I use a POST Call and pass a file to this API. To test this, I looked for a free service on the website rapidapi.com/ which can receive a file via POST Call.
#sap #apicall #fileupload #abap
▬▬ My Hardware ▬▬▬▬▬▬▬▬▬▬▬▬▬
Microphone: amzn.to/3zj2UIz
Headphone: amzn.to/3GUBRFg
*The links are affiliate links. There are no additional costs.
▬▬ My Software (free) ▬▬▬▬▬▬▬▬▬▬▬
Video Recorder: bit.ly/678fgh6
Video Editor: bit.ly/38Rj9lb
Thumbnail: bit.ly/CustAndCodeThumbnail
Gamma AI: bit.ly/3nsdvgr
▬▬ Further Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⭐Become my subscriber: bit.ly/CustAndCodeSub
🎬All videos in English: bit.ly/CustAndCodeENG
☕Buy me a Coffee 😀: bit.ly/3dih2cl
This video helped me solve the problem I was facing! Thank you!
Awesome to hear. And thank you for watching! 🤗
This is a great video and very detailed explanation.. Thanks a lot
Thank you very much for your feedback and thanks for watching 🤗😀
You are an absolute life saver
hehe, nice to hear that! Thanks for your comment 🤗
Hi,
I know the video is not about that but would you know how I can disable fields in the tcode BP (business partner)? I'm trying for BUPT but I'm not succeeding.
Unfortunately, I can't tell you anything about this yet, because we haven't changed over yet ourselves. That will still take a few months. 🤗
@@CustAndCode I managed to do my enhancement, but I thank you all the same. I'm starting now as an ABAP developer and your videos help a lot.
@@davialves6021 Thank you for your feedback! 🤗 ABAP is nice, you will see 🤗😀
Hi! please, could you explain in a video how to configure ADS to show Adobe Forms ? thanks!!
Unfortunately, I have very rarely used ADS myself. 🙄
Hello and thanks. I need desperately to understand how I respond to an external rest api by sending a csv file in multipart as it would be huge. So my response must return a multipart file besides some other information data. I will be much obliged if you can help me. Thanks Elias
Unfortunately, I don't have any special experience with that either. 🙄
Hi
Can I get some sample program
In which we can post the pdf file and meta data in JSOn format in one request in rest spi using multipart form object in sap abap
Maybe you can find an API on rapidapi.com or additional sites where you can test your call.
Your code works, but I'm getting SSL handshake error. Did you have to upload a certificate using SAP tcode STRUST ? This is the error I got: SSL handshake failed: SSSLERR_PEER_CERT_UNTRUSTED (-102). Peer's X.509 Certificate (chain) is untrusted
Exactly! You have to upload a certificate using T-Code STRUST. Have a look at this video here: ua-cam.com/video/SXFXWKlIpdE/v-deo.html
How about doing vice versa? File is coming from external server and downloading it to SAP? I have a requirement wherein the file is uploaded in POSTMAN and it will be stored in SAP Application Server. Hope you can help on this. Thanks!
Yes, I made a few videos about that, this is the first one, a simple GET request. ua-cam.com/video/2-32Ru7hnhE/v-deo.html
There are some other too like POST Call or transfere File and so on. hth 🤗
@@CustAndCode a pdf file is uploaded in POSTMAN. I need to convert the json string of the PDF file into BASE64 so I can upload the file in AL11
check the class cl_http_utility 🤗
I need similar kind of requirement where output type document needs to be posted to content server.
This should work or? 🤔
@@CustAndCode I didnot try yet due to environment setup,will find first the plug in point where I can write rest API code. If you have any idea then let me know.
@@nitin11meena Unfortunately, I've never had a requirement like this before. 🤔
Can I use the same program for POST request body for JSON?
Yes you can! 🤗
@@CustAndCode sir can you explain what line of code that i must change if i want to use json post method (only send json format ). sorry im just learn API and still confused step by step to use this api to post json data
thanks
@@ardydk9944 Which API do you use? Is this a public API? Can I try it? Or is it private? 🤔
@@CustAndCode its private API sir, i just receive the url of the API with localhost****, no uname & pass, its possible to send API with this url?
@@ardydk9944 Ok, I will check if i find an public API where I can post a JSON snippet. Then I can provide a sample code. 🤔
Awesome....the POST method for API REST is great...but you could have used JSON format itself.
Thank you! Yes, thats right, ou can use JSON as payload as well. 🤗😀
Can you share the code ?
I already did 😉 Unfortunately I do not provide a blog 🙄
@@CustAndCode You don't use github ?
@@FunHappyAngryBirds Just for backup 🤗
@@CustAndCodeI've implemented your program, but I'm getting certificate error. Did you have to load any certificate in SAP using tcode STRUST ? This is the error I got: SSL handshake with qr-code-and-barcode-scanner.p.rapidapi.com:443 failed: SSSLERR_PEER_CERT_UNTRUSTED (-102)
Peer's X.509 Certificate (chain) is untrusted
@@CustAndCode Your code works, but I'm getting SSL handshake error. Did you have to upload a certificate using SAP tcode STRUST ? This is the error I got: SSL handshake with qr-code-and-barcode-scanner.p.rapidapi:443 failed: SSSLERR_PEER_CERT_UNTRUSTED (-102)
Peer's X.509 Certificate (chain) is untrusted