Here is my code:
Here is the response:
2020/09/14 12:19:51.425: INFO Results for adding ppsEmailAddress as recovery email: {data=[object Object], finalURL=https://www.googleapis.com/admin/directory/v1/users/[email protected], headers={Alt-Svc=h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43", Content-Length=357, Content-Type=application/json; charset=UTF-8, Date=Mon, 14 Sep 2020 19:19:51 GMT, Server=ESF, Vary=[Origin, X-Origin, Referer], X-Content-Type-Options=nosniff, X-Frame-Options=SAMEORIGIN, X-XSS-Protection=0}, initialURL=https://www.googleapis.com/admin/directory/v1/users/[email protected], statusCode=400.0, statusReason=Bad Request}
Trying to follow the Google API reference here, though something wrong with my syntax: https://developers.google.com/admin-sdk/directory/v1/reference/users#resource
"
- it reads,""recoveryEmail:"
when it should be,"recoveryEmail:"
- Is that the issue? – iansedanofinalURL
endpoint has as its email "[email protected]@pps.net", is that it? I have checked the endpoint with your arguments (with a test account) and it works for me so it must be something to do with how the request is being constructed. Maybe you could share the code behind callGoogleAPI()? Or give more details about the platform you are using to make the request. You can also test your specific request using: developers.google.com/oauthplayground – iansedanocallGoogleAPI
or provide the details on complete http request sent to the server. From what I can see the google API expects a JSON. I don't see JSON in your request data. Probably the data should be"{receoveryEmail":+alternateEmail+"}"}
instead of"receoveryEmail":+alternateEmail
as passed by you. – manishg