0

I'm in the middle of converting my older Google Provisioning API applications to the new Directory API. I havent been able to find the equivalent Directory API to the following code below. Could anyone point me to a page or have an example they're willing to share.

Does the new Directory API even have a CreateSendAs()? I'm using the .NET Client Library.

using Google.GData.Apps;
using Google.GData.Apps.GoogleMailSettings;
using Google.GData.Client;
using Google.GData.Extensions;

GoogleMailSettingsService service = new GoogleMailSettingsService("yourdomain", "your-apps");

service.setUserCredentials("adminUsername", "adminPassword");
service.CreateSendAs("liz", "Sales", "sales@example.com", "", "true");
FredNCC
  • 51
  • 1
  • 3

2 Answers2

0

Because createSendAs ( USERNAME, NAME, ADDRESS, REPLYTO, DEFAULT) is meaning to create a send-as alias. Perhaps with using 'Users.aliases' from that library you can replace this.

Dim Email As String = "sales@afs.org" '<--the email of a user you want to add this alias to
Dim aliasEmail As String = "sales@example.com" '<--an alias email you want to add
Dim newAlias As New Google.Apis.Admin.Directory.directory_v1.Data.Alias
newAlias.AliasValue = aliasEmail
newAlias.PrimaryEmail = Email
_ser.Users.Aliases.Insert(newAlias, Email).Execute()

NOTE: _ser is from DirectoryService Class with you already put the certificate of connection with google API.

linnil
  • 1
  • 2
0

No, the directory API does not have an equivalent to the emailsettings API at this time. This page explains how to use it, and will likely have a link to the new API if/when google plans to release one: https://developers.google.com/admin-sdk/email-settings/?csw=1

AbrahamB
  • 1,348
  • 8
  • 13