-
Implementing User Permissions Management with GA4 Admin API and Apps Script
So, I’m working with the v1 alpha GA Admin API using the AnalyticsAdmin Service in AppScript, right? My project is all about managing permissions for a bunch of users right from Google Sheets – pretty cool, huh? I managed to list all user links on properties without a hitch, but I hit a snag when I tried to add a new user. I got an ‘Error 400’ message that says, “The value for the ‘direct_roles’ field was empty, but must be provided.” Bit of a head scratcher, right?
I’ve got my own GCP project and I made sure the API is enabled for it, but I’m still running into this problem. Got any thoughts on why this could be happening? I’d appreciate any and all ideas!
To give you an idea what I’m wrestling with, here’s a look at the request I’m building. I’m taking values right out of cells in Google Sheets to do it:
{ request = [{ parent: 'properties/' + entity[3], notifyNewUser: true, userLink: { emailAddress: entity[5], directRoles: entity[6] } }]; }
Log in to reply.