title: Google Sheets API Post 404 error
body: <p>Am trying to post data to google spread sheet but am getting 404 error,verified my sheet id and all everything looks fine but still am getting a 404 error, below is my code</p>
  
  <pre><code>NSString *baseUrl = @"https://sheets.googleapis.com/v4/spreadsheets/";
  NSString *spreadsheetId = @"MYKEY/edit";
  NSString *range = @"Sheet1!A2:E";
  
  baseUrl= [baseUrl stringByAppendingString:spreadsheetId];
  baseUrl = [baseUrl stringByAppendingString:@"/values/"];
  baseUrl = [baseUrl stringByAppendingString:range];
  
  
  NSMutableDictionary * params=[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"RAW",@"valueInputOption", nil];
  
  NSURL *postURL=[GTLUtilities URLWithString:baseUrl queryParameters:params];
  
  NSLog(@"base url is %@", postURL);
  
  
  GTLObject * body=[[GTLObject alloc]init];
  
  
  NSMutableArray * contentArray=[[NSMutableArray alloc]init];
  NSMutableArray * titleArray=[[NSMutableArray alloc]initWithObjects:@"Student Name",@"Gender",@"Class Level",@"Home State",@"Major",@"Extracurricular Activity",nil];
  NSMutableArray * wheelArray=[[NSMutableArray alloc]initWithObjects:@"TEST",@"TEST",@"50.00",@"100.00",@"2",@"2", nil];
  
  [contentArray addObjectsFromArray:titleArray];
  [contentArray addObjectsFromArray:wheelArray];
  
  NSLog(@"content array is %@", contentArray);
  
  
  NSMutableDictionary * bodyDict=[[NSMutableDictionary alloc]initWithObjectsAndKeys:range,@"range",@"ROWS",@"majorDimension",@"HELLO",@"values", nil];
  NSLog(@"body dict %@",bodyDict);
  
  
  body.JSON=[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"range",range,@"majorDimension",@"ROWS",@"values",@"HELLO", nil];
  
  
  [self.service fetchObjectByUpdatingObject:body forURL:[NSURL URLWithString:baseUrl] completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
  
      if (error==nil) {
  
          NSLog(@"posted content successfully");
      }
  }];
  </code></pre>