Need Help With Integrating Google Admin SDK, Directory API

I’m using the Google Easy JWT Token to return a Bearer.
I’m looking for how to turn that bearer into an API request to pull (1) a list of my users and (2) a list of my groups.
The service account seems to be working, but I don’t know how to structure my API request.
I.E.: what authentication type, headers, etc.
Any help is greatly appreciated!

If you have a bearer token then in the Header add the following pair

Authorization
Bearer xxxxxxxxxxxxxxxxx

Just pick “None or Self Handled”

@NigelG Thanks for that!

Not sure how familiar you are with the Google side, but I have it setup to look like this as you suggest (I’m generating the token and copying/pasting for now):

I have the call set to this:

Based on this:

I know my Google end is correct scope wise, etc., but keep getting this error:

Thanks for any help/advice you can provide!

A service account is not an admin, and you need admin access.

Perform Google Workspace Domain-Wide Delegation of Authority

Okay that makes more sense. I’ll try adding sub to the claim set to so the service account can impersonate me. Thanks so much! Huge help!