Creating Productized SAP C4C Integrations with Virtual Data Resources

By Danielle Laforte in GET/technical, Enterprise Integration Posted Nov 9, 2018

SAP Hybris Cloud for Customer (C4C) is a cloud hosted customer relationship management system that meets international security standards, scales up or down easily, is used in a wide variety of industries, and supports major mobile platforms. C4C's robust Contact and Account relationship management allows for the storing of Account and Contact data in a central place as opposed to distributed systems like Outlook and Mobile devices, as well as the ability to search Accounts and Contacts on various parameters, such as Account Owner, Sales Area, Sales Employee, etc, to zero in on the results that matter to you.

Of course, with so many different applications in use today, having the ability to integrate and enrich C4C with your favorite external application, like Hubspot’s inbound marketing tool, is practically a necessity in this day and age as no one application can truly do it all. But how do you do that in an easy, repeatable way?

In this article, I’ll take a closer look at the complex APIs in C4C that allow for a robust Contact and Account relationship and discuss how the Cloud Elements’ concept of a Virtual Data Resource can simplify the C4C API and help create productized, reusable integrations with Hubspot or any of Cloud Elements’ 150+ Elements (i.e. external applications like Hubspot such as Microsoft Dynamics, MailChimp, etc).

 

 

Account Collection Relationship for SAP C4C API

 

Image 1 - The Account Collection and its relationship to other Collections in the SAP C4C API. 

The image above shows the complex relationships for the Account object (also known as a collection in SAP API parlance). It is this relationship building that allows for the ability to zero in on the relevant data important to you. Let’s explore three collections: the AccountContactsCollection, the AccountContactRelationshipCollection, and the ContactCollection.

The ContactCollection allows you to create, update, delete, a contact to SAP C4C. It encapsulates the AccountContactRelationshipCollection, which in turn encapsulates the AccountContactsCollection. However, as you can see in the following snippets, the AccountContactRelationshipCollection (yellow) can be created independently of the ContactCollection. Further, the AccountContactsCollection (blue) can be created independently of both the AccountContactRelationshipCollection and the ContactCollection.

Create a C4C Contact

 
Create a C4C AccountContactRelationship

Update a C4C AccountContact

Breaking the API down into separate objects in this way allows one to:

  • Create a Contact not attached to an account (POST /ContactCollection)
  • Relate a Contact to an Account, or multiple Accounts (POST /AccountContactRelationshipCollection)
  • Search for all Contacts that are related to a single Account and vice versa (GET /AccountContactRelationshipCollection with query parameters)
  • Retrieve all Contacts that are linked to any Account (GET /AccountContacts) or particular Contacts using query parameters
  • Retrieve the Contact information related to a relationship (GET /AccountContactRelationshipCollection/{id}/AccountContacts)

Let’s now simplify some of the above the resources to create repeatable, productized integrations using Virtual Data Resources.

 

What is a Virtual Data Resource (VDR)?

A VDR is a resource that you create on a Cloud Elements’ Element with a unique name, that allows you define the structure of the request and the response payload. Cloud Elements performs the transformation behind the scenes.

First, let’s explain what an Element is. An Element is much more than a simple connection - and much smarter than a “connector” that all other integration platforms offer. An Element offers:

  • Normalized SQL based query statements
  • A polling framework that is built in when the native endpoint does not offer webhooks.
  • Versioning that is managed for you - backwards compatible with earlier versions
  • Normalized Authentication that is built in for both basic and oauth flows
  • Bulk that is managed and simplified - including chucking of files
  • Always Restful JSON responses even from endpoints with native XML, etc

When you enter your credentials in an Element, you create an Element Instance.

Let’s redefine the ContactCollection and the AccountContactRelationshipCollection with VDRs.

Original C4C Create Contact Payload: (POST /ContactCollection)

 
VDR Payload: POST (/myContact)

Original C4C Create AccountContactRelationship Payload:

(POST /AccountContactRelationshipCollection)

VDR Payload: POST (/myContactRelationship)

Let’s also add a POST /myAccount VDR (original payload not shown)

POST (/myAccount)

Okay, so how does this help me create a productized integration with Hubspot or any other Element in the Cloud Elements’ catalog?

If you also map the Cloud Elements’ Hubspot Element Instance to the VDRs you created above, you can now write business logic that is independent of the endpoint.

Performing a GET /accounts or a GET /contacts on the Hubspot Element Instance will give you the raw Hubspot payload for a company and a contact, respectively. But mapping them to GET /myAccount and /myContact will give the structure you expect, and that C4C now expects (if you also POST to these VDRs in the C4C Element Instance).

Now, you can write generic business logic either in your application or as a Formula in the Cloud Elements Platform. The calls can be made to any Element Instances which are set when a Formula Instance is created.

Cloud Elements Formula

 Image 2 - A Formula, which consists of generic business logic made possible by the use of VDRs. This can be reused as needed. When a Formula Instance is created for a customer, that customer’s Element Instances are associated with this flow.

When each new customer comes along to onboard their integration, all they have to do is:

  • Create their Element Instances by entering their credentials in the Cloud Elements’ Element (Hubspot, C4C, etc)
  • Map the objects (contacts, accounts, etc) to the VDRs (including any custom fields)
  • Create a Formula Instance which reuses the business logic template (Formula) and also associates it with the customer’s specific Element Instances so it knows what accounts to pull the data from.

That’s it. With nothing to deploy, creating productized integrations, to even complex endpoints like C4C, becomes a quick, repeatable process.

Download the Whitepaper