User and UGC Management Service in AEM Communities user-and-ugc-management-service-in-aem-communities

CAUTION
AEM 6.4 has reached the end of extended support and this documentation is no longer updated. For further details, see our technical support periods. Find the supported versions here.
IMPORTANT
GDPR is used as an example in the sections below, but the details covered are applicable to all data protection and privacy regulations; such as GDPR, CCPA etc.

AEM Communities exposes APIs out-of-the-box to manage user profiles and bulk manage user generated content (UGC). Once enabled, the UserUgcManagement service allows the privileged users (community administrators and moderators) to disable user profiles, and bulk delete or bulk export UGC for specific users. These APIs also enable controllers and processors of customer data to comply with the European Union’s General Data Protection Regulations (GDPR) and other GDPR inspired privacy mandates.

For further information see the GDPR page at the Adobe Privacy Center.

NOTE
If you configured Adobe Analytics in AEM Communities site, the captured user data is sent to Adobe Analytics server. Adobe Analytics provides APIs that allow you to access, export, and delete user data and comply with GDPR. For more information, see Submit Access and Delete Requests.

To put these APIs to use, you need to enable the /services/social/ugcmanagement endpoint by activating the UserUgcManagement service. To activate this service, install the sample servlet available on GitHub.com. Then, hit the endpoint on publish instance of your communities site with appropriate parameters using an http request, similar to the following:

http://localhost:port/services/social/ugcmanagement?user=<authorizable ID>&operation<getUgc>

However, you can also build a UI (user interface) to manage user profiles and user generated content in system.

These APIs enable perform the following functions.

Retrieve the UGC of a user retrieve-the-ugc-of-a-user

getUserUgc(ResourceResolver resourceResolver, String user, OutputStream outputStream) helps export all the UGC of a user from the system.

  • user: authorizable ID of a user.
  • outputStream: result is returned as output stream, which is a zip file including the user generated content (as json file) and attachments (which include images or videos uploaded by the user).

For example, to export the UGC of a user named Weston McCall, who uses weston.mccall@dodgit.com as authorizable ID to log in to communities site, you can send an http GET request similar to the following:

http://localhost:port/services/social/ugcmanagement?user=weston.mccall@dodgit.com&operation=getUgc

Delete the UGC of a user delete-the-ugc-of-a-user

deleteUserUgc(ResourceResolver resourceResolver, String user) helps delete all the UGC for a user from the system.

  • user: authorizable ID of the user.

For example, to delete the UGC of a user having authorizable ID weston.mccall@dodgit.com through http-POST request, use the following parameters:

  • user= weston.mccall@dodgit.com
  • operation= deleteUgc

Delete UGC from Adobe Analytics delete-ugc-from-analytics

To delete user data from the Adobe Analytics, follow the GDPR Analytics workflow; as the API does not delete user data from Adobe Analytics.

For Adobe Analytics variables mappings used by AEM Communities, refer the following image:

AEM communities variable mapping for Adobe Analytics

Disable a User Account disable-a-user-account

deleteUserAccount(ResourceResolver resourceResolver, String user) helps disable a user account.

  • user: authorizable ID of the user.
NOTE
Disabling a user deletes all the user generated content that the user has on the server.

For example, to delete the profile of a user having authorizable ID weston.mccall@dodgit.com through http-POST request, use the following parameters:

  • user= weston.mccall@dodgit.com
  • operation= deleteUser
NOTE
deleteUserAccount() API only disables a user profile in the system and removes the UGC. However, to delete a user profile from the system, navigate to CRXDE Lite: https://<server>/crx/de, locate the user node and delete it.
recommendation-more-help
5d37d7b0-a330-461b-814d-068612705ff6