Example API calls | HCL Experience API
To give users more insight on how to use Experience API, the following samples are provided.
Sample process flow: Login, accessing content, and logout
- Call Examples
- Before sending an API call, users need to get the UUID of the content they want to access out
of HCL Digital Experience 9.5. Here are the steps to follow:
- Log in to HCL Digital Experience 9.5 using
http://<PORTAL_HOST>:<PORTAL_PORT>/wps/portal
. - Go to Web Content Authoring.Note:
- If you have Practitioner Studio enabled, navigate to Web Content > Authoring.
- If you do not have Practitioner Studio configured in your Digital Experience 9.5 deployment, navigate to Content > Authoring.
- From Authoring, click on the Web Content > Content > Articles. A list of articles is displayed.
- Click on any article and select Properties > Content Properties.
- Look for UUID value. If not available click on More > Show More Fields.
- Copy the UUID value.
- Log in to HCL Digital Experience 9.5 using
Sample scripts: Login, Get roles, Get roles with authentication
Open the HCL Experience API GraphQL URL: http://localhost:4000/dx/api/core/v1/graphql.
See example result:
- Copy the scripts below and place those in the left panel of the HCL Experience API interface, then click on the execute button: