📌  相关文章
📜  如何在开发者控制台上测试签名补丁 api - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:20.293000             🧑  作者: Mango

代码示例1
GoogleCredential credential;
using (var stream = new FileStream("signature-gmailapi.json", FileMode.Open, FileAccess.Read))
{
    credential = GoogleCredential.FromStream(stream).CreateScoped(new[]
            {GmailService.Scope.GmailSettingsBasic, GmailService.Scope.GmailSettingsSharing})
        .CreateWithUser("admin@domain.com");
}
var service = new GmailService(new BaseClientService.Initializer()
    {
        ApplicationName = "Project",
        HttpClientInitializer = credential
    }
);
service.Users.Settings.SendAs.Patch(new SendAs { Signature = "Test signature..."}, "me",
    "user@domain.com").Execute();