title: cloudprint anonymous register: "Unable to get the authorization code"
body: <p>Totally stuck &amp; lost in Google CloudPrint documentation &amp; python code. I am writing a 'proxy' service connector to interface between printers and Google CloudPrint service. It appears that I am able successfully to first register the printer anonymously (from the proxy), the user can claim it via the provided link. BUT the printer does NOT appear in the user's GCP managed printer list. AND, on the proxy side, I am unable to get the authorization code, with the response returning that as an error. Before the user claims the printer, however, the poll request does return "Token not registered yet." And after the token has expired or been used, it returns: "Unknown, used or expired token." So why won't it return the authorization code and why won't the printer show up in the managed printer list? What is missing from the request?</p>
  
  <p>Here is the request &amp; response for the register phase:</p>
  
  <pre><code>post https://www.google.com/cloudprint/register
  X-CloudPrint-Proxy: "my proxy"
  Content-Type: "multipart/form-data; boundary=-----------RubyMultipartPost"
  Content-Length: "25074"
  Status: 200
  response: Content-Type: "text/plain"
  Set-Cookie: "NID=67=Vr4laL1-skwakQVraGiu-l7i_dONBY5Szu7RAsCiHV5hSRmI8XDUbRQf4l1K7ct5ZCJzPjuZB97wJdvEYUXSGUpsrCnhVZRWuyq-CyQ0KSCvDegdUNz0VgDnH1LPwJBI;Domain=.google.com;Path=/;Expires=Sun, 30-Mar-2014 07:42:54 GMT;HttpOnly"
  {"success"=&gt;true, "polling_url"=&gt;"https://www.google.com/cloudprint/getauthcode?printerid=a274981a-e4e7-ea3c-3ea1-e77adb84b5b4&amp;oauth_client_id=", "invite_page_url"=&gt;"https://www.google.com/cloudprint/regtokenpage?t=q2c5n&amp;dpi=300&amp;pagesize=215900,279400", "complete_invite_url"=&gt;"http://goo.gl/printer/0jg9", "automated_invite_url"=&gt;"https://www.google.com/cloudprint/confirm?token=q2c5n", "oauth_scope"=&gt;"https://www.googleapis.com/auth/cloudprint", "token_duration"=&gt;"899", "request"=&gt;{"time"=&gt;"0", "params"=&gt;{"default_display_name"=&gt;["HP-LaserJet-1020test"], "proxy"=&gt;["my proxy"], "auth_client_id"=&gt;["AIzaSyDnm....PeW0lu9Y"], "printer"=&gt;["HP-LaserJet-1020test"]}}, "registration_token"=&gt;"q2c5n" ... 
  </code></pre>
  
  <p>Here is the poll request &amp; response for the authorization code:</p>
  
  <pre><code>post https://www.google.com/cloudprint/getauthcode?printerid=a274981a-e4e7-ea3c-3ea1-e77adb84b5b4&amp;oauth_client_id=AIzaSyD.....Mpe2PByWPeW0lu9Y
  X-CloudPrint-Proxy: "my proxy"
  Cookie: "NID=67=Vr4laL1-skwakQVraGiu-l7i_dONBY5Szu7RAsCiHV5hSRmI8XDUbRQf4l1K7ct5ZCJzPjuZB97wJdvEYUXSGUpsrCnhVZRWuyq-CyQ0KSCvDegdUNz0VgDnH1LPwJBI"
  Status: 200
  response: Content-Type: "text/plain"
  
  {"success"=&gt;false, "message"=&gt;"Unable to get the authorization code.", "request"=&gt;{"time"=&gt;"0", "params"=&gt;{"oauth_client_id"=&gt;["AIzaSyDnmcwkVP....WPeW0lu9Y"], "printerid"=&gt;["a274981a-e4e7-ea3c-3ea1-e77adb84b5b4"]}}, "errorCode"=&gt;505}
  </code></pre>