Retrieve user data using GraphQL API
A walkthrough: get everything the platform holds about one user, by any identifier.
Your goal
Retrieve the data held about one user, starting from whatever identifier you have - for an access request, a support investigation, or a real-time personalisation call.
Expected outcome
A single response containing the fields you need, and an understanding of what the response does not include.
Prerequisites
An authenticated call. For code running in a browser or an app, use signature authentication, not a long-term token.
One identifier for the user.
Fields present in your schema - the GraphQL schema is derived from yours.
Walk through it
Start from the identifier you have
Each identifier type has its own selector function:
A UserPoint ID
user_point(user_point_id: "...")
An email hash
user_point_by_email_hash(email_hash: "...")
An account ID and a compartment ID
user_point_by_user_account_id(compartment_id: "...", user_account_id: "...")
A user agent ID
user_point_by_user_agent_id(user_agent_id: "...")
When GraphQL is the wrong tool
You need the complete history of a user, beyond 100 activities
OTQL, or Explore a user profile to read the raw activities
You need data for many users
OTQL, or a query export
You need to write something
The GraphQL endpoint is read-only. See Server-side events
You are answering a formal access request
Exercise rights of the user, which also covers looking the person up by every identifier they gave you
Verify
The minimal query returns an
id, confirming the identifier resolves.Every field you request exists in your schema - an unknown field is a query error, not an empty value.
For anything depending on completeness, you have accounted for the 100-activity limit.
Calls stay within the endpoint's rate limit;
429means you exceeded it.
Related pages
Last updated
Was this helpful?