Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.



Company
Cherrywork Digital Applications
Digital and AI
SAP Services
Industries
Resources

Cherrywork.com

Create an API in SAP API Management to upload file without using Postman

WRITTEN BY

Sumandeep Kaur
PUBLISHED​
3rd June 2022
INTEGRATION
SHARE

Hello Everyone!

            This is my first blog post. For the past few months, I have been working on APIs as part of my work. An API is a software intermediary that allows two applications to talk to each other and also various policies can be applied to these APIs. I have created APIs in ‘Create in API designer’ component of SAP API Portal and tested various pre-packaged APIs to understand how they behave.

Introduction:

This blog post describes how to design API to upload file from your system to target system without using Postman. I have configured one iflow in SAP CPI with HTTPS on sender side and FTP adapter on receiver side. I have triggered that iflow from SAP API management to send file to target end point of iflow.

Prerequisites:

Access to SAP API Portal and SAP CPI (Cloud Platform Integration).

Host server url.

Target server url.

Steps to be followed to upload file.

Step 1: Configure iflow.

Configure an iflow in SAP CPI with HTTPS on sender side and FTP adapter on receiver side. FTP adapter can be configured to send file to DriveHQ as it provides virtual FTP server to store files. Deploy the iflow and copy the end point.

API file upload
Step 2: Create API
Create an API in ‘Create in API designer’ section in SAP API Portal in OpenAPI Specification 3.0.1 and add target server url of iflow end point. This API will consume Multipart/form-data and will upload file.
edit in API Designer

Note: Keep the Post method end point same as CPI iflow end point and don’t add that end point in target server url, it will add Post method end point and trigger an iflow.

Step 3: Try Out in API Portal
Now save and deploy the API and try uploading the file in try out option in ‘Resources’. Click on choose file to select file from your system.
blog upload file new
Note: Add header as Authorization and value Basic Base64 encoded credentials same as your CPI credentials.
Step 4: Execute and file will be sent.
Click on execute, your CPI iflow will be triggered and file will be sent through FTP adapter to DriveHQ.
Drive Start Menu
Note: Files with .txt format can be downloaded and opened. But files with .pdf and .docx formats have to be edited in DriveHQ and add extension of file format (.docx,.pdf ) before downloading.

Conclusion: SAP API Management supports API-led integrations across various parties and systems. It’s very interesting and simple to design APIs in Create in Designer section in OpenAPI Specification 3.0.1.  This API helps to send file from your system to target system without using Postman.

Related Stories
Security Spotlight: Why Staying on SAP PI/PO Puts Your Data at Risk

Security Spotlight: Why Staying on SAP PI/PO Puts Your Data at Risk

SAP Process Integration (PI) and Process Orchestration (PO) have long been the backbone of integration and orchestration for SAP landscapes. They serve as the central platforms for integrating various SAP and non-SAP systems, managing workflows, and orchestrating business processes across the enterprise.