Next, we are going to set up the connection to the SAP Sales Cloud OData API. This can be done by configuring an OData type data resource in SAP AppGyver.
As a reminder (since you first learned about this in the earlier units):
- an API allows us to fetch data from SAP Sales Cloud to use in our extension app.
- OData is an open API standard used by many SAP APIs.
- JSON is a popular data format used by APIs.
Using an API URL to connect to SAP Sales Cloud
This is our mock API URL for the OData service:
https://my346234.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/$metadata
Make sure to use below Basic Authentication credentials as you configure the integration in SAP AppGyver:
Credentials for Basic Authentication
Field | Value |
---|---|
User | Demouser |
Password | Welcome1 |
An API URL is really just like any other web address, except that it is used to communicate data between two systems. As stated before, the API URL we are providing is different from a real SAP Sales Cloud API, in that it has been created specifically for the learners of this unit. However, the data returned looks just like real data from a live SAP Sales Cloud API. Before getting into the configuration in SAP AppGyver, we can verify that the OData API URL works by simply using our browser to visit the URL. What we see is the XML metadata of the OData service. Fortunately, we don’t have to care too much about it, as SAP AppGyver will know what to do with this URL!
In case you happen to have access to a SAP Sales Cloud instance with the OData API, you can create the app using your own instance. In this case you should use the URL to your SAP Sales Cloud instance in the format:
https://my1234567890.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/$metadata
Do note that when using your own instance, you’ll need to create some appointments in your system to be able to list and filter it in the extensions app! Depending on your setup, you should also have your login credentials for the Sales Cloud instance, as you’ll need to enter them for the Basic Authentication configuration when configuring the integration in SAP AppGyver.

OData configuration
To start configuring the OData integration we have to connect the OData API with SAP AppGyver. We do this by clicking on the Data tab at the top.

Next click on add Data resource and click on OData integration.


Now, copy in this URL: https://my346234.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/$metadata
For Authentication choose Basic Authentication and use the credentials Demouser / Welcome1 to connect SAP AppGyver with the OData API. Click on Verify URL and switch on the AppointmentCollection resource and save the data resource.

Click on the created data resource, scroll down and switch on all the related resources by clicking on the switches, and then press SAVE DATA RESOURCE.


Let us test the resource so that we can see what it contains. To do that, click on the newly created OData integration.

Next, click on the list subcategory and switch to the Test tab.
To test the results, enter Demouseras Keyword and Welcome1 as Password.

To test the resource, scroll down and click on the Run Test button.
Testing the resource, we can see that some data is returned.
This data is in the JSON data format, which we also already heard about in Unit 4. The data is a list of objects; in JSON notation, the entire list itself is enclosed with square brackets [ ] and within the list there are 3 objects which are our 3 Appointments, and each one is enclosed by curly brackets { }. We don’t need to do anything directly with the JSON data, but understanding the JSON structure, and being able to verify the test results will help us in developing integrations like this one.

You can see the schema, or structure of the information, in the schema tab. This describes the structure of the information. SAP AppGyver will store and use this structure, making it easy to work with the data resource as we develop our app.

Exit the Data tab by clicking it again to get back to the canvas.