הפרמטר state מקודד ככתובת URL, כך שהאפליקציה צריכה לטפל בתוויות הבריחה ולנתח אותו כ-JSON.
משתמשים ואירועים חדשים
אפליקציות של Drive צריכות להתייחס לכל אירועי היצירה ככניסות פוטנציאליות. יכול להיות שלמשתמשים מסוימים יש כמה חשבונות, ולכן יכול להיות שמזהה המשתמש בפרמטר state לא יתאים לסשן הנוכחי. אם מזהה המשתמש בפרמטר state לא תואם לסשן הנוכחי, צריך לסיים את הסשן הנוכחי באפליקציה ולהיכנס כמשתמש המבוקש.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 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"]]