SAP Hybris Cloud for Customer CRM Authenticate an Element

On this page

You can authenticate with SAP Hybris Cloud for Customer to create your own instance of the SAP Hybris Cloud for Customer CRM element through the UI or through APIs. Once authenticated, you can use the element instance to access the different functionality offered by the SAP Hybris Cloud for Customer platform.

Authenticate Through the UI

Use the UI to authenticate with SAP Hybris Cloud for Customer and create an element instance. Because you authenticate with SAP Hybris Cloud for Customer via OAuth 2.0, all you need to do is add a name for the instance. After you create the instance, you'll log in to SAP Hybris Cloud for Customer to authorize Cloud Elements access to your account. For more information about authenticating an element instance, see Authenticate an Element Instance (UI)

After successfully authenticating, we give you several options for next steps. Make requests using the API docs associated with the instance, map the instance to a virtual data resource, or use it in a formula template.

Authenticate Through API

Use the /instances endpoint to authenticate with SAP Hybris Cloud for Customer and create an authenticated element instance. If you are authenticating with events, see the Events section.

Note: The endpoint returns an element token upon successful completion. Retain the token for all subsequent requests involving this element instance.

To authenticate an element instance:

  1. Construct a JSON body as shown below (see Parameters):

    {
        "element": {
          "key": "sapc4ccrm"
        },
        "configuration": {
          "subdomain": "<domain>.crm.ondemand.com",
          "username": "<YOUR_SAP_Hybris Cloud for Customer_USERNAME>",
          "password": "<YOUR_SAP_Hybris Cloud for Customer_PASSWORD>"
        },
        "tags": [
          "ElementDocs"
          ],
        "name": "<AUTHENTICATED_INSTANCE_NAME>"
    }
    
  2. Call the following, including the JSON body you constructed in the previous step:

    POST /instances
    
    Note: Make sure that you include the User and Organization keys in the header. For more information, see Authorization Headers, Organization Secret, and User Secret.
  3. Locate the token and id in the response and save them for all future requests using the element instance.

Example cURL

curl -X POST \
  https://api.cloud-elements.com/elements/api-v2/instances \
  -H 'Authorization: User <INSERT>, Organization <INSERT>'  \
  -H 'content-type: application/json' \
  -d '{
  "element": {
    "key": "sapc4ccrm"
  },
  "configuration": {
    "subdomain": "<domain>.crm.ondemand.com",
    "username": "<YOUR_SAP_Hybris Cloud for Customer_USERNAME>",
    "password": "<YOUR_SAP_Hybris Cloud for Customer_PASSWORD>"
  },
  "tags": [
    "ElementDocs"
  ],
  "name": "SAPHybris Cloud for CustomerAPI3"
}
'

Parameters

API parameters not shown in Cloud Elements are in code formatting.

Note: Event related parameters are described in Events.
ParameterDescriptionData Type
'key'The element key.
sapc4ccrm
string
Name
name
The name for the element instance created during authentication.string
Subdomain
subdomain
The url of your SAP Hybris Cloud for Customer CRM site. Replace in the default url with your own information.
UsernameYour user name for SAP Hybris Cloud for Customer CRM.String
PasswordYour password for SAP Hybris Cloud for Customer CRM.String
tagsOptional. User-defined tags to further identify the instance.string

Example Response

{
  "id": 50753,
  "name": "SAPC4HDCAPI2",
  "createdDate": "2017-05-22T04:12:16Z",
  "token": "jDCglCWOTvIjkqB54Kaz249kXcydo+ADNUUcPR1FriI=",
  "element": {
    "id": 5354,
    "name": "SAP Hybris Cloud for Customer CRM",
    "key": "sapc4chd",
    "description": "Add a SAP Cloud for Customer (Hybris Cloud for Customer) Instance to connect your existing SAP Cloud for Customer (Hybris Cloud for Customer) account to the CRM Hub, allowing you to manage accounts, contacts, incidents, etc. across multiple CRM elements. You will need your SAP Cloud for Customer (Hybris Cloud for Customer) account information to add an instance.",
    "image": "elements/provider_sapc4c.png",
    "active": true,
    "deleted": false,
    "typeOauth": false,
    "trialAccount": false,
    "resources": [],
    "transformationsEnabled": true,
    "bulkDownloadEnabled": true,
    "bulkUploadEnabled": true,
    "cloneable": true,
    "extendable": false,
    "beta": false,
    "authentication": {
      "type": "basic"
    },
    "extended": false,
    "hub": "CRM",
    "protocolType": "odata",
    "parameters": [
      {
        "id": 3990,
        "createdDate": "2017-05-17T09:37:05Z",
        "name": "subdomain",
        "vendorName": "siteUrl",
        "type": "configuration",
        "vendorType": "path",
        "source": "request",
        "elementId": 5353,
        "required": false
      }
    ],
    "private": false
  },
  "elementId": 5353,
  "provisionInteractions": [],
  "valid": true,
  "disabled": false,
  "maxCacheSize": 0,
  "cacheTimeToLive": 0,
  "configuration": {  },
  "eventsEnabled": false,
  "traceLoggingEnabled": false,
  "cachingEnabled": false,
  "externalAuthentication": "none",
  "user": {  }
}