SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Integrate SAP Build Apps with SAP Integration Suite

how to test request calls in SAP Build Apps (formerly SAP AppGyver) to a SAP Integration Suite API and how to set up the needed schema for sending payloads.

Overview

🎓 intermediate 25 min. SAP AppgyverIntermediateFree TierSAP Integration SuiteSAP Business Technology PlatformSAP Build

You will learn

  • โœ”How to test request calls in SAP Build Apps to a SAP Integration Suite API.
  • โœ”How to set up the needed schema for sending payloads.
  • โœ”How to retrieve data from a request call’s response.
Mariajose Martinez M Mariajose Martinez December 5, 2022
Created by October 28, 2022
Contributors

Prerequisites

Prerequisites

Steps

Step 1 Add the API Endpoint in SAP Build Apps
โ€”

  1. Go to your SAP Build Apps custom app, click on Data on the menu and Add a Data Resource and select REST API direct integration. Remember that for this exercise, it is needed to create first a custom mobile application from this blog post.

    Creating a new API connection
    Creating a new API connection

  2. Copy and paste your API endpoint from SAP API Management as the base resource URL and name your Data Resource. Enter the name: IntegrationSuite_API_CORS.

    Adding API endpoint
    Adding API endpoint

  3. Click on the Create Record (POST) section, make sure id is erased from the relative path and enter your API Key as a header (make sure you don’t put it as optional and mark it as static).

    Adding the API Key as a header
    Adding the API Key as a header

  4. Set up the custom needed schema for testing a POST request. Remember the payload structure you are using for this exercise:

    JSON
    {
    "AppGyverSalesOrder": {
        "customer": {
        "ObjectID": "<Object ID from SAP C4C>",
        "BuyerPartyID": <BuyerPartyID from SAP C4C>
        },
        "paymentData": {
        "amount": <Payment transaction amount to be processed in Stripe>,
        "customer": "<stripe customer id>",
        "currency": "<currency selected in stripe account>",
        "source": "<card id>",
        "description": "Test payment via CPI"
        },
        "product": [
        {
            "ProductID": "<Product ID from SAP C4C>",
            "Quantity": <Product quantity to be purchased>
        }
        ]
    }
    }

    So to “translate it” into the custom schema in SAP Build Apps, you’ll need to add these properties manually, as shown in the following image:

    Adding the schema propertis for Payloads to be sent
    Adding the schema propertis for Payloads to be sent

  5. Click on the Test tab and open your custom object, where you are going to add the values as the payload for testing.

    Adding some values to test the call
    Adding some values to test the call

    And setting for testing purposes a Product ID from SAP Sales and Service core (formerly SAP Cloud for Customer or SAP C4C).

    Set Product Id from SAP Sales and Service Core to test it
    Set Product Id from SAP Sales and Service Core to test it

  6. Save it and now click on Run Test. You should see this response Status: OK:

    Test response
    Test response

  7. If you check on your Stripe developers account, you can see the amount and description “Ta da!! Integration scenario is set up”:

    Test Stripe charge
    Test Stripe charge

Step 2 Create a variable from the request call's response
+
Step 3 Update your variables to send the Payload
+
Step 4 Create a page variable with a new JSON Object
+
Step 5 Configure with a button the request call trigger
+
Step 6 Test the whole integration scenario
+
Step 7 Review the conclusions
+
Step 8 Check your knowledge
+
Step 9 One more time, check your knowledge
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 9
1. Add the API Endpoint in SAP Build Apps 2. Create a variable from the request call's response 3. Update your variables to send the Payload 4. Create a page variable with a new JSON Object 5. Configure with a button the request call trigger 6. Test the whole integration scenario 7. Review the conclusions 8. Check your knowledge 9. One more time, check your knowledge

Learn more →