Learn how to manage user contexts in Opigno Enterprise, including their creation, updating, retrieval, and activation or deactivation. This guide covers best practices for handling identity, permissions, and privacy through user contexts.
Is the Opigno-Client-UUID required for every API request?
Opigno-Client-UUID
header is required for every API request, regardless of whether the user is authenticated or anonymous. This ensures that every user interaction—authenticated or anonymous—can be tracked and managed via a unique user context.What is the difference between an Authorization header and Opigno-Client-UUID?
What headers are required for API requests?
your-user-uuid
Authorization
header shows who you are (your application’s identity), and the Opigno-Client-UUID
header shows which user you want to manage or get information about.How do I handle authenticated vs. anonymous users?
setUserContext
with the scope
set to AUTHENTICATED
.setUserContext
without the scope
field. This allows tracking of progress and actions for anonymous users, without exposing PII or requiring authentication.Opigno-Client-UUID
header, regardless of whether the user is authenticated or anonymous. This ensures that every user interaction—authenticated or anonymous—can be tracked and managed via a unique user context.
setUserContext
with the scope
set to AUTHENTICATED
.setUserContext
without the scope
field.setUserContext
mutation examples below for both cases.
AUTHENTICATED
: Standard authenticated userClick here to see the scopes
AUTHENTICATED
.uuid
(e.g., anon-<random>
)displayName
(e.g., “Anonymous User”)isActive: true
scope
fieldsetUserContext
GraphQL mutation.
Prepare the GraphQL Mutation
Click here to see the parameters
true
to activate the user context upon creation.AUTHENTICATED
for registered users. Omit for anonymous users.Verify the Response
errors
array is empty, the user context was created successfully.setUserContext
mutation with the updated fields. For anonymization:
displayName
if you do not want to expose real names.Click here to see the parameters
displayName
if you do not want to expose real names.getUserContext
GraphQL query to fetch details about a user context.
Construct the GraphQL Query
Review the Response
isActive
field using the setUserContext
mutation:
isActive
is true
and unpublished when isActive
is false
.