title: Google Drive API downloadUrl 404 in iOS
body: <p>So I am trying to allow two users to swap files that each has in their Google Drive. That involves knowing the ID of the other person's file and using the API calls to retrieve it. Both files sit in folders that have been shared to anyone/public.</p>
  
  <p>Trouble is when I execute the code below I am finding that each user can only use the downloadUrl corresponding to the file they own - the others return a 404. In this case either "mine" or "theirs" depending on the account I'm logged into.</p>
  
  <pre><code>    // _driveService and its authorizer setup elsewhere        
  
      // Retrieve the metadata then the actual data
      NSString *mine = @"0B4Pba9IBDsR3T1NVTC1XSGJTenc";
      NSString *theirs = @"0B4n9OyY8tqWpNlNaN1dUc3FsNG8";
      NSString *get = [NSString stringWithFormat:@"https://www.googleapis.com/drive/v2/files/%@",theirs];
      [_driveService fetchObjectWithURL:[NSURL URLWithString:get] completionHandler:^
       (GTLServiceTicket *ticket, GTLDriveFile *file, NSError *error)
       {
           if (error != nil)
               NSLog(@"Error retrieving metadata: %@", error);
           else
           {
               // Download the actual data
               GTMHTTPFetcher *fetcher = [_driveService.fetcherService fetcherWithURLString:file.downloadUrl];
               [fetcher beginFetchWithCompletionHandler:^
                (NSData *data, NSError *error)
                {
                    if (error != nil)
                        NSLog(@"Error retrieving actual data: %@", error);
                    else
                    {
                        NSString *content = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                        NSLog(@"Content: %@", content);
                    }
                }];
           }
       }];
  </code></pre>
  
  <blockquote>
    <p>Error retrieving actual data: Error Domain=com.google.HTTPStatus Code=404 "The operation couldn’t be completed. (com.google.HTTPStatus error 404.)"</p>
  </blockquote>
  
  <p>What am I doing wrong here? If it's a permissions thing, why am I allowed to get the metadata?</p>
  
  <p>Note this is for an iOS app and both files were created and uploaded from the app using the official client API (rev 353).</p>