title: Google API Rest: Exchange authorization code for refresh and access tokens - error 404
body: <p>I get 404 errors while following step by step the "Using OAuth 2.0 for Web Server Applications" help page. <a href="https://developers.google.com/identity/protocols/OAuth2WebServer" rel="noreferrer">Using OAuth 2.0 for Web Server Applications</a></p>
  
  <p>I use http/rest requests.</p>
  
  <p>Everything is OK until step 5 : "Exchange authorization code for refresh and access tokens".</p>
  
  <p>My request (POST or GET) returns a 404 error: "Not Found".
  Here is my request, the same as in the guide:</p>
  
  <pre><code>https://www.googleapis.com/oauth2/v4/token?
  code=4/_XXXXXXXXXXXXXXXXXXX__XXXXXXXXXXXXXX-XXXXXX?&amp;client_id=012345678912-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.apps.googleusercontent.com&amp;client_secret=XXXXXXXXXXXXXXXXXXX_XXXX&amp;grant_type=authorization_code&amp;redirect_uri=http%3a%2f%2fwww.mydomain.com%3a50000%2fMyPage
  </code></pre>
  
  <p>Here is the related part of the guide:</p>
  
  <blockquote>
    <p>"To exchange an authorization code for an access token, call the
    <a href="https://www.googleapis.com/oauth2/v4/token" rel="noreferrer">https://www.googleapis.com/oauth2/v4/token</a> endpoint and set the
    following parameters:</p>
    
    <p>Fields</p>
    
    <p>code  The authorization code returned from the initial request.</p>
    
    <p>client_id The client ID obtained from the API Console.</p>
    
    <p>client_secret The client secret obtained from the API Console.</p>
    
    <p>redirect_uri  One of the redirect URIs listed for your project in the
    API Console.</p>
    
    <p>grant_type    As defined in the OAuth 2.0 specification, this field must
    contain a value of authorization_code."</p>
  </blockquote>
  
  <p>I think there is a problem with the service URL. Am I wrong?</p>
  
  <p>Can any one provide the working URL?</p>