FOLDER_RESOURCE_KEY: Üst klasörün kaynak anahtarı.
USER_ID: Kullanıcıyı benzersiz şekilde tanımlayan profil kimliği.
Uygulamanız, aşağıdaki adımları uygulayarak bu isteği yerine getirmelidir:
action alanının değerinin create olduğunu doğrulayın.
Kullanıcı için yeni bir oturum oluşturmak üzere userId değerini kullanın. Oturum açmış kullanıcılar hakkında daha fazla bilgi için Kullanıcılar ve yeni etkinlikler başlıklı makaleyi inceleyin.
Dosya kaynağı oluşturmak için files.create yöntemini kullanın. İstekte folderId ayarlandıysa parents alanını folderId değerine ayarlayın.
state parametresi URL olarak kodlandığından uygulamanızın kaçış karakterlerini işleyip JSON olarak ayrıştırması gerekir.
Kullanıcılar ve yeni etkinlikler
Drive uygulamaları, tüm "oluşturma" etkinliklerini olası oturum açma işlemleri olarak ele almalıdır. Bazı kullanıcıların birden fazla hesabı olabilir. Bu nedenle, state parametresindeki kullanıcı kimliği mevcut oturumla eşleşmeyebilir. state parametresindeki kullanıcı kimliği geçerli oturumla eşleşmiyorsa uygulamanızın geçerli oturumunu sonlandırın ve istenen kullanıcı olarak oturum açın.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-02-24 UTC."],[[["When a user creates a new file with your app from Drive UI, your app receives a `state` parameter containing action, folder details, and user ID."],["Your app should verify the `action` is \"create\", create a user session, and use the provided information to create a new file via the Drive API."],["All \"create\" events should be treated as potential sign-ins and handled to accommodate users with multiple accounts, potentially requiring session switching."],["The `state` parameter is URL-encoded and needs to be parsed as JSON by your application for proper data extraction."]]],["When a user selects an app via Drive UI's \"New\" button, Drive redirects to the app's New URL, sending a `state` parameter. The `state` includes `action` (set to \"create\"), `folderId`, `folderResourceKey`, and `userId`. The app must verify the `action`, initiate a new user session based on `userId`, use `files.create` to generate a file resource, and handle `folderId` and `folderResourceKey`. All \"create\" events should be treated as potential sign-ins, with user sessions adjusted accordingly. The `state` parameter is URL-encoded JSON and must be parsed.\n"]]