Custom User Profile Attributes with Oracle Content Management and Free Widget.

Custom User Profile Attributes with Oracle Content Management and Free Widget.

Sometimes you need the ability to add custom user profile attributes for users to manage such as User Image, Location, Address, Locale and more - did you know you can use the Oracle Content Management Rest API for users and groups to assign custom properties against accounts and use the OCM profile within your site!

Here is a screenshot of the OCM Profile screen below - you can easily consume and manage all of the profile data and manage your image throught the APIs including adding your own props.

💡
...if a profile field is empty though - the key is not returned in the JSON resultset from the API.
💡
FYI.. if you do add new user profile properties they won't be displayed here there are only accessible and controlled from the APIs

Official REST API

Integrating and Extending Oracle Content Management
You can use the Oracle Cloud REST API for Users and Groups to manage users, groups, one-on-one conversations, and pictures.

User Management Profile Examples with OCM

Here are the endpoints for managing a user profile to create, update and read user properties.

Uploading and managing a User Profile Image

You can send a file to the pictures API endpoint referencing the userID as the pictureID.

/social/api/v1/pictures/{pictureID} (PUT)
https://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-users-groups/op-pictures-pictureid-put.html

Reading the user Profile Image

There are two ways to do this but here is the official way - I'll discuss in an later blog post on how you can use the undocumented front & back channels OCM provides which for me is the better approach..

/social/api/v1/pictures/{pictureID} (GET)
https://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-users-groups/op-pictures-pictureid-get.html

Adding a Custom Profile property

You can check to see if the user propery exists if  it doesn't create it with this command.

/social/api/v1/people/{peopleID}/properties (POST)
https://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-users-groups/op-people-peopleid-properties-post.html

Reading User Profile Properties

Here you can call all the user properties; great for generating a user profile page.

/social/api/v1/people/{peopleID}/properties (GET)
https://docs.oracle.com/en/cloud/paas/content-cloud/rest-api-users-groups/op-people-peopleid-properties-get.html
💡
I'll be creating a few sample Gists showing how to call these API endpoints as the documentation for social is unfortunately very limited and doesn't cover all the requirements..

Demo Widget (In Development...70%)

Now we have the basics covered - lets pull this all together and create a mini profile widget that enables users to:

  • Create and manage their social links.
  • Change their profile image.
  • Update their name & job title.
Example Profile Widget

Download and View source @github

GitHub - JohnRSim/OCM-Profile-Widget: Free Custom Component for displaying and managing profile image and social links for OCM sites
Free Custom Component for displaying and managing profile image and social links for OCM sites - GitHub - JohnRSim/OCM-Profile-Widget: Free Custom Component for displaying and managing profile imag...

I hope this has helped - show some cool features hidden away in the platform.