0

line of code where we call a Google API enter image description here

Response:

<HEAD>
<TITLE>HTTP method PUT is not supported by this URL</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>HTTP method PUT is not supported by this URL</H1>
<H2>Error 405</H2>
</BODY>
</HTML>
, finalURL=https://www.googleapis.com/auth/admin/directory/v1/users/ttestaccount@pps.net, headers={Alt-Svc=h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43", Cache-Control=private, max-age=0, Content-Security-Policy=frame-ancestors 'self', Content-Type=text/html; charset=UTF-8, Date=Tue, 22 Sep 2020 23:03:06 GMT, Expires=Tue, 22 Sep 2020 23:03:06 GMT, Server=GSE, Transfer-Encoding=chunked, X-Content-Type-Options=nosniff, X-Frame-Options=SAMEORIGIN, X-XSS-Protection=1; mode=block}, initialURL=https://www.googleapis.com/auth/admin/directory/v1/users/ttestaccount@pps.net, statusCode=405.0, statusReason=HTTP method PUT is not supported by this URL}
<br><br>

Seems like I am using the same URL format as recommended in Google Reference Guide here: https://developers.google.com/admin-sdk/directory/v1/reference/users/update

enter image description here

Jose Vasquez
  • 1,678
  • 1
  • 6
  • 14
joshgoldeneagle
  • 4,616
  • 2
  • 23
  • 30
  • If I try method PATCH instead of PUT, I get: "Method PATCH is not defined in RFC 2068 and is not supported by the Servlet API" – joshgoldeneagle Sep 22 '20 at 23:25
  • 1
    I can see you are using this URL: `https://www.googleapis.com/auth/admin/directory/v1/users/ttestaccount@pps.net` instead of using `https://www.googleapis.com/admin/directory/v1/users/userKey` without the **.../auth/...** where **userKey** should be unique identifier with this format **D04x2xmn8** for instance. – Jose Vasquez Sep 23 '20 at 09:09
  • If I take out the /auth/ I get the HTTP Response statusCode=403.0, statusReason=Forbidden. – joshgoldeneagle Sep 23 '20 at 23:26
  • The Google reference web site https://developers.google.com/admin-sdk/directory/v1/reference/users/update says the user key "can be the user's primary email address, alias email address, or unique user ID." I am using primary email address in this case. – joshgoldeneagle Sep 23 '20 at 23:29
  • **HTTP 405** means a method is not allowed in that URL. If by removing **/auth** you get a **403** that probably is because you are not using the **Authorization Scope** or your token expired. As a recommendation I would use [oauthplayground](https://developers.google.com/oauthplayground/) to make requests. Keep in mind the Auth scope, in this case: `https://www.googleapis.com/auth/admin.directory.user`. – Jose Vasquez Sep 25 '20 at 11:32
  • When I try using PUT to update recovery email from "Try this API" at https://developers.google.com/admin-sdk/directory/v1/reference/users/update everything is successful. Not sure what I need to change here: https://imgur.com/a/PAtAyoc – joshgoldeneagle Sep 25 '20 at 23:53
  • The only field that differs from the "Try this API" tool is **connection**. For further investigation, can you please provide the code related, at least the part where you call the API. – Jose Vasquez Sep 28 '20 at 07:42
  • Here is the code that is related where I call the API: https://i.stack.imgur.com/l2ey4.png – joshgoldeneagle Sep 28 '20 at 23:36
  • **callGoogleAPI** is doing something we don't know and it would be helpful if you edit your question and paste your code instead of images (including the function). – Jose Vasquez Sep 29 '20 at 08:40
  • The development environment I have no choice about using is called Rapid Identity from the Identity Automation company, and they do not allow me to copy and paste to something outside the platform (I can copy and paste within the platform). That is why I provided a screen capture of the code. – joshgoldeneagle Oct 01 '20 at 02:32

0 Answers0