Social Media User

Overview

The Social Media User service is used to store and manipulate social media user data, which can be harvested from social media channels. You can map the harvested social media users to Engagement Center customer accounts. This enables you to understand your customers better, based on their social media activities. The Social Media User service also provides the functionality of basic consent management. Make sure that the social media user data you stored in this service is fully compliant with all applicable laws and regulations. SAP does not accept any liability for the use of the service.

Using this service, you can:

  • Retrieve social media users
  • Store social media users
  • Delete social media users
  • Update social media users


API Reference

/{tenant}/socialMediaUsers

This resource defines the GET, POST methods for social media users.

/{tenant}/socialMediaUsers

get

Retrieve a list of social media users. If no query parameter is specified, a limited number of social media users will be returned. Using the query parameter q, you can filter and get social media users with specific attributes. The GET method is paged. Use the query parameter pageNumber to control which page is retrieved. Use the query parameter pageSize to control the number of social media users per page. The default pageSize is 16.

Required scope: hybris.socialmediauser_view

post

Create a list of social media user items.

This method can be called to store the social media users harvested from your desired social media channels, and you can map the harvested social media users to Engagement Center customer accounts. If you can’t get all the required data from the social media channel directly, you may need to prepare them on your own before calling this method:

  • communicationMediumID : The social media channel where the social media user is harvested
  • socialMediaUserID : The social media user identifier of the social media channel
  • consentGivenBy : The person who confirms that the consent to store the social media user data is obtained
  • consentGivenOn : Time when the consent to create the social media user is given
  • socialMediaUserProfileLink : URL to open the social media user profile directly on social media channel
  • socialMediaUserProfilePhotoLink : The link of the social media user photo.
  • country : The country code restricted to ISO standard

Required scope: hybris.socialmediauser_manage

/{tenant}/socialMediaUsers/{id}

This resource defines the GET, PUT and DELETE methods for individual social media user.

get

Get a social media user item.

Retrieve an individual social media user by the its specific id.

Required scope: hybris.socialmediauser_view

put

Update an existing social media user item.

Update a social media user item with its identified id.

You can't update follow data fields when calling this method:

  • communicationMediumID: The social media channel where the social media user is harvested
  • socialMediaUserID: The social media user identifier of the social media channel

If you try to update the following data fields with empty value when calling this method, we will keep these two fields with the old values:

  • consentGivenBy: The person who confirms that the consent to store the social media user data is obtained
  • consentGivenOn: Time when the consent to create the social media user is given

Required scope: hybris.socialmediauser_manage

delete

Delete a social media user item.

The social media user to be deleted is identified by its id.

Required scope: hybris.socialmediauser_delete


Scopes

The table shows the scopes that the Social Media User service supports.

SCOPEDESCRIPTION
hybris.socialmediauser_viewRead-only access to social media user data
hybris.socialmediauser_deleteDelete social media user data
hybris.socialmediauser_manageCreate and update social media user data

For more information about scopes, authorization, and authentication procedures for YaaS services, see Scopes and Authorization.


Prerequisites

To manage social media users derived from the corresponding social media channels, store the user data and map the user data to a customer account. You must obtain the user’s consent, according to the laws and regulations concerning private data and protection.


Management of Social Media Users

You can use the resource socialMediaUsers to manage the social media users derived from the corresponding social media channels, such as Facebook, Twitter, and SAP Jam Communities. To use this feature, you must define the social media channels from which to derive social media user data. Do this in the Social Media Settings Builder module.


Social Media User Creation

To create a social media user, you must specify the social media channel and the social media user ID.

These attributes are mandatory when creating a social media user:

  • communicationMediumID
  • socialMediaUserID (refers to one particular user in connection to one particular communication channel)
  • consentGivenOn (see the Prerequisites section)
  • consentGivenBy (see the Prerequisites section)
When you create a social media user, the service generates a unique identifier (id) for the user.

For more information about creating social media users, see Create Social Media User.


Social Media User Update

You can update the attributes of the social media user, by using the attribute id.

These attributes cannot be changed after you create the social media user:

  • id refers to one particular user. The Social Media User service generates the ID when you create a social media user.
  • communicationMediumID
  • socialMediaUserID refers to one particular user in connection with one particular communication channel.

For more information about updating social media users, see Update a Social Media User.


Social Media User Retrieval

You can retrieve existing social media users by using a query to find one or more users, or by retrieving a single social media user by id.

Retrieve multiple social media users

You can use query parameters to retrieve social media users. These attributes are unique and only apply to one user:

  • id
  • socialMediaUserID within one communicationMediumID

For more information about retrieving multiple social media users, see Search Social Media Users.

Retrieve social media user by ID

After a social media user is created, the service generates an id for it. You can use the id to search for the individual social media user.

For more information, see Retrieve Social Media User.


Customer Account Mapping

To map the social media user to a customer account, specify the value of the attribute referenceCustomerNumber in the social media user data. The attribute represents the customer account ID that is linked to the social media user.

You can link several social media users to the same account by assigning the identical referenceCustomerNumber to the appropriate social media users.

To remove the mapping between a social media user and a customer account, you must set the referenceCustomerNumber to NULL.

For more information, see Update a Social Media User.

The service does not validate the customer account ID, and thus cannot prevent the assignment of social media users to invalid or non-existent accounts.


Create Social Media User

Request

To create a social media user, use the information shown to perform the request.

  • Method: POST
  • Request URL: https://api.beta.yaas.io/hybris/socialmediauser/v1/{tenant}/socialMediaUsers
  • Headers
    • Authorization: This includes a valid OAuth2 access token. To access this method, the access token must be issued for the requested tenant and have the scope hybris.socialmediauser_manage.
  • URI Parameters
    • {tenant}: The name of the current tenant
  • Body: The mandatory attributes include communicationMediumID, socialMediaUserID, consentGivenBy, and consentGivenOn.
      {
          "communicationMediumID":"SAP_COMMUNITY",
          "socialMediaUserID":"1234567",
          "socialMediaUserAccountName":"Mary",
          "socialMediaUserNickName":"Sky",
          "socialMediaEmail":"mary.smith@hybristest.com",
          "creationDateTime":"2015-10-02T14:10:00.000+0000",
          "socialMediaUserProfileLink":"www.facebook.com/useraccount/userprofile",
          "socialMediaUserProfilePhotoLink":"www.facebook.com/useraccount/userprofile/photo.img",
          "consentGivenOn":"2015-12-02T14:10:00.000+0000",
          "consentGivenBy":"John Marker",
          "firstName":"Mary",
          "lastName":"Smith",
          "fullName":"Mary Smith",
          "provider":"Twitter",
          "country":"CN",
          "referenceCustomerNumber":"09876"
      }
    

Response

The successful response returns a 201 status code. An example JSON content looks similar to the following:

{
    "id":"54d1df314b4e9a3a90135790123",
    "link":"https://api.beta.yaas.io/repository/v2/test/test/data/socialMediaUsers/54d1df314b4e9a3a90135790123"
}


Retrieve Social Media User

You can retrieve the details of a social media user by using the unique id the system generates for each social media user.

The request body does not need to contain any information. The service sends the required data together with the URI parameters and the headers.

The example provided shows how to retrieve a social media user by using the unique id.

You can retrieve the social media user details by using the request information shown:

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/socialmediauser/v1/{tenant}/socialMediaUsers/{id}
  • Headers
    • Authorization: This includes a valid OAuth2 access token. To access this method, the access token must be issued for the requested tenant and have the scope hybris.socialmediauser_view.
  • URI Parameters
    • {tenant}: The name of the current tenant
    • {id}: The unique identifier of the social media user

Response

The successful response returns a 200 status code. An example JSON content looks similar to the following:

{
    "id": "56d7fcffa80d1d001d27cb2f",
    "communicationMediumID":"SAP_COMMUNITY",
    "socialMediaUserID":"1234567",
    "socialMediaUserAccountName":"Mary",
    "socialMediaUserNickName":"Sky",
    "socialMediaEmail":"mary.smith@hybristest.com",
    "creationDateTime":"2015-10-02T14:10:00.000+0000",
    "socialMediaUserProfileLink":"www.facebook.com/useraccount/userprofile",
    "socialMediaUserProfilePhotoLink":"www.facebook.com/useraccount/userprofile/photo.img",
    "consentGivenOn":"2015-12-02T14:10:00.000+0000",
    "consentGivenBy":"John Marker",
    "firstName":"Mary",
    "lastName":"Smith",
    "fullName":"Mary Smith",
    "provider":"WeChat",
    "country":"CN",
    "referenceCustomerNumber":"09876"
}


Search Social Media Users

You can search for relevant social media users by specifying query parameters, such as specific attributes. This example shows how to search for social media users by specifying attributes as query parameters.

To search for social media users, use the information shown to perform the request:

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/socialmediauser/v1/{tenant}/socialMediaUsers
  • Headers
    • Authorization: This includes a valid OAuth2 access token. To access this method, the access token must be issued for the requested tenant and have the scope hybris.socialmediauser_view.
  • URI Parameters
    • {tenant}: The name of the current tenant
  • Query Parameters
    • Use PageNumber to control which page is retrieved. Page numbering starts with 1.
    • Use PageSize to control the number of social media users per page.
    • q stands for specific attributes. For example, socialMediaUserID:48857334and referenceCustomerNumber:09876.

Query parameters are not mandatory. If no query parameter is specified, a limited number of social media users is returned.

Response

The successful response returns a 200 status code. An example JSON content looks similar to the following:

[
    {
        "id": "56d7fcffa80d1d001d27cb2f",
        "communicationMediumID":"SAP_COMMUNITY",
        "socialMediaUserID":"1234567",
        "socialMediaUserAccountName":"Mary",
        "socialMediaUserNickName":"Sky",
        "socialMediaEmail":"mary.smith@hybristest.com",
        "creationDateTime":"2015-10-02T14:10:00.000+0000",
        "socialMediaUserProfileLink":"www.facebook.com/useraccount/userprofile",
        "socialMediaUserProfilePhotoLink":"www.facebook.com/useraccount/userprofile/photo.img",
        "consentGivenOn":"2015-12-02T14:10:00.000+0000",
        "consentGivenBy":"John Marker",
        "firstName":"Mary",
        "lastName":"Smith",
        "fullName":"Mary Smith",
        "provider":"WeChat",
        "country":"CN",
        "referenceCustomerNumber":"09876"
    },
    {
        "id": "56d7fcffa80d18001d27cb2f",
        "communicationMediumID":"SAP_COMMUNITY",
        "socialMediaUserID":"7654321",
        "socialMediaUserAccountName":"John",
        "socialMediaUserNickName":"Blue",
        "socialMediaEmail":"john.smith@hybristest.com",
        "creationDateTime":"2016-10-08T14:09:00.000+0000",
        "socialMediaUserProfileLink":"www.facebook.com/useraccount/userprofile",
        "socialMediaUserProfilePhotoLink":"www.facebook.com/useraccount/userprofile/photo.img",
        "consentGivenOn":"2016-12-03T14:10:00.000+0000",
        "consentGivenBy":"John Marker",
        "firstName":"John",
        "lastName":"Smith",
        "fullName":"John Smith",
        "provider":"WeChat",
        "country":"CN",
        "referenceCustomerNumber":"09815"
    }
]


Update a Social Media User

You can modify social media user attributes, with the exception of id, communicationMediumID, and socialMediaUserID.

Follow this example to update a social media user by id:

Request

  • Method: PUT
  • Request URL: https://api.beta.yaas.io/hybris/socialmediauser/v1/{tenant}/socialMediaUsers/{id}
  • Headers
    • Authorization: This includes a valid OAuth2 access token. To access this method, the access token must be issued for the requested tenant and have the scope hybris.socialmediauser_manage.
  • URI Parameters
    • {tenant}: The name of the current tenant
    • {id}: The unique identifier of the social media user
  • Body: The request body must contain the consentGivenBy and consentGivenOn attributes.

    1. Properties of an existing social media user:

      {
       "id":"58088245e7d599001dea4329",
       "socialMediaUserID": "123s32d4567",
       "socialMediaUserAccountName":"Mary",
       "socialMediaUserNickName":"Sky",
       "socialMediaEmail":"mary.smith@hybristest.com",
       "creationDateTime":"2015-10-02T14:10:00.000+0000",
       "socialMediaUserProfileLink":"www.facebook.com/useraccount/userprofile",
       "socialMediaUserProfilePhotoLink":"www.facebook.com/useraccount/userprofile/photo.img",
       "consentGivenOn":"2015-12-02T14:10:00.000+0000",
       "consentGivenBy":"John Marker",
       "communicationMediumID": "SAP_COMMUNITY",
       "firstName":"Mary",
       "lastName":"Smith",
       "fullName":"Mary Smith",
       "provider":"Twitter",
       "country":"CN",
       "referenceCustomerNumber":"09876"
      }
      
    2. To change the attributes for the social media user, you need to send a request that includes the properties to be changed. The remaining attributes must be included in the request with the original values.

      {
       "socialMediaUserAccountName":"Mary lee",
      "consentGivenOn":"2015-12-02T14:10:00.000+0000",
       "consentGivenBy":"John Marker"
      }
      
    3. If you retrieve this user's data now, the properties are modified. Note that you cannot update the id, communicationMediumID, or socialMediaUserID by calling PUT method.

      {
       "communicationMediumID": "SAP_COMMUNITY",
      "consentGivenOn":"2015-12-02T14:10:00.000+0000",
       "consentGivenBy":"John Marker",
       "id":"58088245e7d599001dea4329",
       "socialMediaUserAccountName":"Mary lee",
       "socialMediaUserID": "123s32d4567"
      }
      

The successful response returns a 204 status code.


Delete a Social Media User

The Social Media User service allows you delete a social media user by user id.

To delete a social media user, use the information shown to perform the request:

Request

  • Method: DELETE
  • Request URL: https://api.beta.yaas.io/hybris/socialmediauser/v1/{tenant}/socialMediaUsers/{id}
  • Headers
    • Authorization: This includes a valid OAuth2 access token. To access this method, the access token must be issued for the requested tenant and have the scope hybris.socialmediauser_delete.
  • URI Parameters
    • {tenant}: The name of the current tenant
    • {id}: The unique identifier of the social media user

Response

The successful response returns a 204 status code.


Error Types

For information about error codes, see the API Reference.


Glossary

TermDescription
Engagement Center customer accountA user that an agent can identify in the Engagement Center.


  • Send feedback

    If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.

  • Get Help

    Use our private help channel. Receive updates over email and contact our specialists directly.

  • hybris Experts

    If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.