title: Google Apps Script: How to store data on google cloud storage?
body: <p>I want to store google documents on google cloud storage. I am a admin user and have access for google cloud storage.
  I using this code:</p>
  
  <pre><code> function myFunction() {
  
     var base="https://www.googleapis.com/auth/devstorage.full_control"
    var fetchArgs=googleOAuth_('provisioning',base)
    fetchArgs.payload=&lt;content_data_that you want to put on GCS&gt;
    fetchArgs.method='PUT'
    fetchArgs. contentType=&lt;content_type&gt;
    fetchArgs.host="&lt;bucket_name&gt;.storage.googleapis.com"
    var url='https://storage.googleapis.com/&lt;bucket_name&gt;/&lt;file_name&gt;' 
    var result=UrlFetchApp.fetch(url,fetchArgs)
      }
  
  function googleOAuth_(name,scope) {
    var oAuthConfig = UrlFetchApp.addOAuthService(name);
    oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
    oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
    oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
      oAuthConfig.setConsumerKey(consumerKey);
    oAuthConfig.setConsumerSecret(consumerSecret);
    return {oAuthServiceName:name, oAuthUseToken:"always"};
  }
  </code></pre>
  
  <p>When I run this code, it gives 503 server error.
  Any suggestion would be helpful to me.</p>
  
  <p>This problem has been solved. Updated the code with correction.</p>