/// <summary> /// Run the code example. /// </summary> /// <param name="user">The Dfa user object running the code example. /// </param> public override void Run(DfaUser user) { // Create CreativeGroupRemoteService instance. CreativeGroupRemoteService service = (CreativeGroupRemoteService) user.GetService( DfaService.v1_20.CreativeGroupRemoteService); long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); int groupNumber = int.Parse(_T("INSERT_GROUP_NUMBER_HERE")); string creativeGroupName = _T("INSERT_CREATIVE_GROUP_NAME_HERE"); // Create creative group structure. CreativeGroup creativeGroup = new CreativeGroup(); creativeGroup.id = -1; creativeGroup.name = creativeGroupName; creativeGroup.groupNumber = groupNumber; creativeGroup.advertiserId = advertiserId; try { // Create creative group. CreativeGroupSaveResult creativeGroupSaveResult = service.saveCreativeGroup(creativeGroup); // Display new creative group id. Console.WriteLine("Creative group with id \"{0}\" was created.", creativeGroupSaveResult.id); } catch (Exception e) { Console.WriteLine("Failed to create creative group. Exception says \"{0}\"", e.Message); } }
public CreativeGroupSaveResult saveCreativeGroup(CreativeGroup creativeGroup) { object[] results = this.Invoke("saveCreativeGroup", new object[] {creativeGroup}); return ((CreativeGroupSaveResult) (results[0])); }