Skip to Content
Technical Articles
Author's profile photo Mayara Regazio

Using Generic Connector On SAP Customer Data Platform

SAP Customer Data Platform (CDP) has a vast number of connectors available for integration with different types of applications, as a source or destination of data. Despite of this, we may face some cases the client has applications that still do not have an OTB(Out-of-the-box) CDP connector, or the application version is not compatible with the current CDP connector.

During a CDP implantation, the current version of the client’s SAP CAR was not compatible with the was not compatible with the CDP connector. As the client was implementing CPI, I used a simple solution provided by CDP, the generic connector provided by CDP and CPI so that CDP could ingest the data from the source.

Below I am going to show the steps I followed to configure the generic connector and how I tested the API calls to the endpoint provided by the connector.

How To Set Up The Generic Connector In CDP

As the application is being configured to send activity data to CDP, on the menu go to Connect then Sources and click on the button Connect Application.

The Application Library will prompt, choose the Server Application under custom applications category.

CDP%20OTB%20Connectors

A window prompts so you can define the name of the connector, the fields Description and Data Quality Rank are optional.

Connector%20Settings

After clicking on Create button, the new connector is available under Sources:

And the user key and secret key for the connector is generated, the combination of them is used to authenticate the application that makes the API calls to CDP. All requests are conducted over HTTPS when using user and secret keys to authenticate the API calls.

After the connector was ready, I created the event which was used to ingest the data of a specific activity into CDP. To do this, click on the button Create New Event in the connector area.

Creating The Event

To create a new event, a name and data type are required in the first step, Settings.

In the step 2, Model, I created the schema of the activity that is be ingested, in this case Order activity. Every time you create a new event in a connector, you need to create the activity schema or create the schema from a JSON file.

On the step 3, Mapping, the Model fields were mapped with the customer identifier fields in Profile schema and Order activity schema as the data of this activity will be ingest through the event PostEvent created.

In the last step the event listener is generated for the event. It is endpoint that will be used by SAP CPI for integration.

After this, the event was created and is enabled so it can be used:

 

Using CDP APIs To Test The Connector

I used the CDP APIs to simulate the integration of CPI and CDP using Postman. This helped on verifying the payload that need to be send to CDP and anticipated any issue that could occur during the integration and assist the CPI architect with the correct format of the JSON.

On Postman, I used the method POST and copied the URL provided in the event on the step 4, Listener. The URL indicates which CDP domain will be reached depending on where the Business Unit was created:

  • For Business Units in EU: cdp.EU5-prod.gigya.com
  • For Business Units in US: cdp.US5-prod.gigya.com

We can ingest one or multiple activities using the following CDP APIs:

  • For one activity: /api/businessunits/{businessUnitId}/applications/{applicationId}/dataevents/{dataEventId}/event
  • For multiple activities: /api/businessunits/{businessUnitId}/applications/{applicationId}/dataevents/{dataEventId}/events

For both CDP APIs you need to send, in the body of the API call, the payload with the data of one or multiple activities, respectively, observing the structure of fields and field types defined in the step 2, Model, of the event.

After the data ingestion, you can check the events processed in the connector status.

In this case, six events were processed indicating the integration with the CDP connector is working.

 

For more information about how to integrate CDP using API calls see the SAP Help Portal Server Applications: API Integrations and about the CDP APIs.

Feel free to add a comment if you have a feedback or suggestion.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Tobias Schneider
      Tobias Schneider

      Hi Mayara,

      thanks for your blog post! 🙂

      Do you maybe have an screenshot of your Postman configuration (Authorization and Headers)?

      I'm getting a "403 forbidden" when trying to call the event endpoint...

      BR Tobias

      Author's profile photo Mayara Regazio
      Mayara Regazio
      Blog Post Author

      Hi, Tobias.

      Actually the Postman configuration (Authorization and Headers) is the default one, I did not need to change it.

      I only added the userKey and secret as query parameters (in Params tab of Postman) and was able to perform the call. You can find the values of your userKey and secret in the Application Key session of the connector you created.

      Regards,

      Mayara Regazio

      Author's profile photo Tobias Schneider
      Tobias Schneider

      Hi Mayara Regazio,

      thanks for your response. If I set the Authorization to "NoAuth" and instead add the App Key and Secret as params like you said, I also get a 403... Do you see any mistakes I did?

      BR Tobias

      Author's profile photo Mayara Regazio
      Mayara Regazio
      Blog Post Author

      Hi, Tobias,

      As per the screenshot you sent, everything seems to be correct.

      Maybe you can try to generate the application key and test the new credential for the event.

      Or try to create a new event in the connector to check if you can call it successfully.

      Best regards,

      Mayara Regazio

      Author's profile photo Hoang Vu Mai
      Hoang Vu Mai

      Tobias, sometimes the user and api key in CDC/CDP has special character (such as "+")

      Since you put the userKey and secret on params, you need to URL encode it before putting in postman. See if it works.

      Author's profile photo Peter SNOWDON
      Peter SNOWDON

      Thanks for the article, I have managed to set the event and access it but for my simple event model I always get this type of error.

      {
      "callId": "c4b5b4ccffd54493b4c0575b93593899",
      "errorCode": 400000,
      "errorMessage": "Bad Request",
      "apiVersion": 2,
      "statusCode": 400,
      "statusReason": "Bad Request",
      "time": "2023-11-10T14:11:43.145Z"
      }

      I pass the json in the body of a POST request but it fails systematically.

      any help appreciated

      Author's profile photo Peter SNOWDON
      Peter SNOWDON

      Ignore me, it helps if you click on the nearly invisible enable button 🙂