0

Running a POST with the following:

https://www.googleapis.com/admin/directory/v1/users/{{userid}}/aliases/

With the following as the body in JSON

{
    "alias":"person@gsuite.company.com"
}

Im just getting the following error

{
    "error": {
        "code": 400,
        "message": "Invalid Input: alias_email",
        "errors": [
            {
                "message": "Invalid Input: alias_email",
                "domain": "global",
                "reason": "invalid"
            }
        ]
    }
}

I would love some help on this because its getting super frustratinu

Google Support Page https://developers.google.com/admin-sdk/directory/v1/guides/manage-user-aliases

  • What are you using for `{{userid}}` in the request URL? – Rafa Guillermo Apr 21 '21 at 07:32
  • The user id is a varible with just one of the emails in the secondary domain with the gsuite part thats listed in the body – Benjamin King Apr 22 '21 at 23:02
  • What do you mean when you say secondary domain? – Rafa Guillermo Apr 26 '21 at 07:55
  • Secondary domain in the Google Workplace environment. Looks like you cant add any aliases via the API this way, the error is that it cant do it not that there is a syntax error.. I have added an alias to the main domain and the gsuite.company.com domain alias appeared automatically. Mental note always give your secondary domains in Google Workplace an alias to the main domain. – Benjamin King Apr 27 '21 at 23:03

1 Answers1

0

See comments above, but always give your secondary domains in Google Workplace an alias to the main domain and the domain alais will appear