Hi team, I need to update all users’ email attrib...
# gooddata-cloud
v
Hi team, I need to update all users’ email attributes in GoodData (e.g., their email IDs). Here’s what I’m planning to do: 1. Get all users: gooddataApi.get(
/api/v1/entities/users?page=${page}&size=20&metaInclude=page,ALL
) 2. Fetch user data from our database. 3. Patch the updated emails: gooddataApi.patch(
/api/v1/entities/users/${userId}
, payload) payload = { data: { attributes: { email }, id: userId, type: 'user' } } Before I run this in production, I’d like to back up all existing user data. Is there an export feature or recommended way to back up all users from wizehive-zengine.cloud.gooddata.com? Thanks in advance for any guidance!
m
Hi Vivek, thank you for reaching out to us. We can confirm that you can export all user information using our Users - Declarative API. This API allows you to retrieve the current state of your entire user list. You can find more details on this API here: https://www.gooddata.com/developers/cloud-native/doc/cloud/api-and-sdk/api/#API-DeclarativeAPI It's crucial to be aware that user management is unique compared to other GoodData objects (like metrics or dashboards). Users are not solely defined by the data in our API endpoints; they are also integrated and connected with the Identity Provider (IdP), such as Auth0, especially if you are using OpenID Connect (OIDC) for authentication. While updating the email attribute via our API is possible, you must proceed very carefully. For example, if there's a discrepancy or a change in a user's information within your OIDC provider that doesn't align with what you're pushing via the GoodData API, it can lead to authentication failures for that user. Even if the user endpoint's data is correctly passed in GoodData, inconsistencies with the IdP can cause login issues. Therefore, we strongly advise always testing your script thoroughly in a non-production environment before running it in production. I hope this help.
v
Thanks, Mauricio