/// <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 CreativeFieldRemoteService instance. CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService( DfaService.v1_20.CreativeFieldRemoteService); long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE")); string creativeFieldName = _T("INSERT_CREATIVE_FIELD_NAME_HERE"); // Create creative field structure. CreativeField creativeField = new CreativeField(); creativeField.id = -1; creativeField.name = creativeFieldName; creativeField.advertiserId = advertiserId; try { // Create creative field. CreativeFieldSaveResult creativeFieldSaveResult = service.saveCreativeField(creativeField); // Display creative field id. Console.WriteLine("Creative field with id \"{0}\" was created.", creativeFieldSaveResult.id); } catch (Exception ex) { Console.WriteLine("Failed to add creative field. Exception says \"{0}\"", ex.Message); } }
public CreativeFieldSaveResult saveCreativeField(CreativeField creativeField) { object[] results = this.Invoke("saveCreativeField", new object[] {creativeField}); return ((CreativeFieldSaveResult) (results[0])); }