title: Google Drive API with ColdFusion
body: <p>I started to work on Google Drive API with ColdFusion and I am stuck to upload the file using ColdFusion. I have done with the registration of new project, getting client and client secret and I am successfully able to get the accessToken but somehow I am not able to upload the file on the google drive.</p>
  
  <pre><code>Here is the code to get the code and accesstoken
  
  &lt;cfoutput&gt;  
    &lt;cfset request.oauthSettings = {
     scope = "https://www.googleapis.com/auth/drive",      client_id = "clientid",
     client_secret = "clientsecret",
     redirect_uri = "link"}
    /&gt;      
    &lt;!--- create login url ---&gt;
    &lt;cfset loginURL = "https://accounts.google.com/o/oauth2/auth?scope=" 
     &amp; request.oauthSettings["scope"]
     &amp; "&amp;redirect_uri=" &amp; request.oauthSettings["redirect_uri"]
     &amp; "&amp;response_type=code&amp;client_id=" &amp; request.oauthSettings["client_id"]
     &amp; "&amp;access_type=offline"
    /&gt;
  
    &lt;a href="#loginURL#"&gt;Login with Google account that has access to analytics&lt;/a&gt;
  
    &lt;cfif isDefined("URL.code") AND URL.code NEQ "access_denied"&gt;     
      &lt;cfhttp url="#arguments.gaOauthUrl#" method="post"&gt;
       &lt;cfhttpparam name="code" type="formField" value="#arguments.code#"&gt;
       &lt;cfhttpparam name="client_id" type="formField" value="clientid"&gt;
       &lt;cfhttpparam name="client_secret" type="formField" value="clientsecret"&gt;
       &lt;cfhttpparam name="redirect_uri" type="formField" value="link"&gt;
       &lt;cfhttpparam name="grant_type" type="formField" value="authorization_code"&gt;
      &lt;/cfhttp&gt;       
    &lt;/cfif&gt;    
  &lt;/cfoutput&gt;
  </code></pre>
  
  <p>I am using the following code to upload the file, I know I have to pass some more parameters to make it correct but I don't know what are that parameters. </p>
  
  <pre><code>&lt;cfhttp url="https://www.googleapis.com/upload/drive/v2/files?uploadType=media" method="post"&gt;
    &lt;cfhttpparam name="Content-Type" type="formField" value="text/plain"&gt;
    &lt;cfhttpparam name="Authorization" type="formField" value="#session.ga_accessToken#"&gt;            
  &lt;/cfhttp&gt;
  </code></pre>
  
  <p>I am trying to find out in the google docs but no luck; there is no documentation for ColdFusion. Please let me know the other parameters if someone has some clue about this area.</p>