Description
Response of permission insert operation sometimes does not return emailAddress property even if the value of request property type was set to user. Nevertheless the permission is successfully inserted. When you send the request second time (but permission is already created), the response is correct.
The Google Drive API documentation says:
Property:
emailAddress - string - The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Request:
POST https://www.googleapis.com/drive/v2/files/FILE_ID/permissions?access_token=ACCESS_TOKEN Content-Type: application/json { "role": "reader", "type": "user", "value": "fuse.salesforce@gmail.com" }
Response:
{ "kind": "drive#permission", "etag": "\"Lie3Y624-6bAlCGsnUSYyb6P-dU/UIjiGw1Fka3NLCzU08DWihpk0m8\"", "id": "03171240407236930839", "selfLink": "https://www.googleapis.com/drive/v2/files/0B6w8rYOdxgEHeEJZdmdFb0lkS0k/permissions/03171240407236930839", "role": "reader", "type": "user" }
Response 2:
{ "kind": "drive#permission", "etag": "\"Lie3Y624-6bAlCGsnUSYyb6P-dU/QyAkx3EvZskilI7B0C4EtTn_tj4\"", "id": "03171240407236930839", "selfLink": "https://www.googleapis.com/drive/v2/files/0B6w8rYOdxgEHeEJZdmdFb0lkS0k/permissions/03171240407236930839", "name": "fuse salesforce", "emailAddress": "fuse.salesforce@gmail.com", "domain": "gmail.com", "role": "reader", "type": "user" }
Result is nondeterministic. Mostly (for me) email address is not set in the response, but sometimes it is.