HTTP Request for gsuite user creation

Hello, hope all is well!

I’m working on a workflow to create google users in a specific domain thought the http request node. (no g suite node, I need to use http request) The credentials are ok, but I got a problem in the parameters, I didn’t find the correct way to set the name, I know name is formed by “givenName” and “familyName” values, so, how can I set it in n8n options?

I tried to put both in separated parameters and in the same parameters, but I didn’t work.

These are the error messages:

error: UNKNOWN ERROR - check the detailed error for more information
Invalid value at ‘body.name’ (type.googleapis.com/ccc.hosted.frontend.directory.v1.UserName), “example”

and

error: UNKNOWN ERROR - check the detailed error for more information
Invalid Given/Family Name: FamilyName

Can someone help me? please

I already read Directory API: User Accounts  |  Google Developers

Regards

image

Hi @Vic

Not sure if you can create users like this. Might be that you will need to create a JSON body first and post that to the api.

Your familyName and givenName seem to be part of a name object in the JSON.
You could try altering the fieldname to name.familyName & name.givenName.

But that is a wild guess.

Best thing would to generate the full JSON body for this request I think.

2 Likes

Hello @BramKn thank you so much!

I created the json body and now it works :slight_smile:

Regards

1 Like