/// <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 SpotlightRemoteService instance.
            SpotlightRemoteService service = (SpotlightRemoteService)user.GetService(
                DfaService.v1_19.SpotlightRemoteService);

            // Set search criteria.
            CountrySearchCriteria countrySearchCriteria = new CountrySearchCriteria();

            countrySearchCriteria.secure = false;

            try {
                // Get countries.
                Country[] countries = service.getCountriesByCriteria(countrySearchCriteria);

                // Display country names, codes and secure server support information.
                if (countries != null)
                {
                    foreach (Country result in countries)
                    {
                        Console.WriteLine("Country name \"{0}\", country code \"{1}\", supports a secure " +
                                          "server? \"{2}\".", result.name, result.id, result.secure);
                    }
                }
            } catch (Exception e) {
                Console.WriteLine("Failed to retrieve countries. Exception says \"{0}\"", e.Message);
            }
        }
        /// <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 SpotlightRemoteService instance.
            SpotlightRemoteService service = (SpotlightRemoteService)user.GetService(
                DfaService.v1_20.SpotlightRemoteService);

            long   spotlightConfigurationId = long.Parse(_T("INSERT_SPOTLIGHT_CONFIGURATION_ID_HERE"));
            int    activityType             = int.Parse(_T("INSERT_ACTIVITY_TYPE_HERE"));
            string groupName = _T("INSERT_GROUP_NAME_HERE");

            // Set spotlight activity group structure.
            SpotlightActivityGroup spotlightActivityGroup = new SpotlightActivityGroup();

            spotlightActivityGroup.id = 0;
            spotlightActivityGroup.spotlightConfigurationId = spotlightConfigurationId;
            spotlightActivityGroup.groupType = activityType;
            spotlightActivityGroup.name      = groupName;

            try {
                // Create the activity group.
                SpotlightActivityGroupSaveResult result = service.saveSpotlightActivityGroup(
                    spotlightActivityGroup);

                // Display activity group id.
                if (result != null)
                {
                    Console.WriteLine("Activity group with id \"{0}\" was created.", result.id);
                }
            } catch (Exception ex) {
                Console.WriteLine("Failed to create spotlight activity group. Exception says \"{0}\"",
                                  ex.Message);
            }
        }
Example #3
0
        /// <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 SpotlightRemoteService instance.
            SpotlightRemoteService service = (SpotlightRemoteService)user.GetService(
                DfaService.v1_19.SpotlightRemoteService);

            try {
                // Get method types.
                SpotlightTagMethodType[] spotlightTagMethodTypes = service.getSpotlightTagMethodTypes();

                //Display method type names and ids.
                foreach (SpotlightTagMethodType result in spotlightTagMethodTypes)
                {
                    Console.WriteLine("Method type with name \"{0}\" and id \"{1}\" was found.",
                                      result.name, result.id);
                }
            } catch (Exception ex) {
                Console.WriteLine("Failed to retrieve tag method types. Exception says \"{0}\"",
                                  ex.Message);
            }
        }
Example #4
0
        /// <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 SpotlightRemoteService instance.
            SpotlightRemoteService service = (SpotlightRemoteService)user.GetService(
                DfaService.v1_20.SpotlightRemoteService);

            long   activityGroupId = long.Parse(_T("INSERT_ACTIVITY_GROUP_ID_HERE"));
            long   activityTypeId  = long.Parse(_T("INSERT_ACTIVITY_TYPE_ID_HERE"));
            long   tagMethodTypeId = long.Parse(_T("INSERT_TAG_METHOD_TYPE_ID_HERE"));
            long   countryId       = long.Parse(_T("INSERT_COUNTRY_ID_HERE"));
            string url             = _T("INSERT_EXPECTED_URL_HERE");
            string activityName    = _T("INSERT_ACTIVITY_NAME_HERE");

            // Set spotlight activity structure.
            SpotlightActivity spotActivity = new SpotlightActivity();

            spotActivity.id = 0;
            spotActivity.activityGroupId = activityGroupId;
            spotActivity.activityTypeId  = activityTypeId;
            spotActivity.tagMethodTypeId = tagMethodTypeId;
            spotActivity.name            = activityName;
            spotActivity.expectedUrl     = url;
            spotActivity.countryId       = countryId;

            try {
                // Create the spotlight tag activity.
                SpotlightActivitySaveResult result = service.saveSpotlightActivity(spotActivity);

                // Display new spotlight activity id.
                if (result != null)
                {
                    Console.WriteLine("Spotlight activity with id \"{0}\" was created.", result.id);
                }
            } catch (Exception ex) {
                Console.WriteLine("Failed to create spotlight activity. Exception says \"{0}\"",
                                  ex.Message);
            }
        }
Example #5
0
        /// <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 SpotlightRemoteService instance.
            SpotlightRemoteService service = (SpotlightRemoteService)user.GetService(
                DfaService.v1_20.SpotlightRemoteService);

            long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE"));

            // Set activity group search criteria structure and
            // use advertiser id as search criteria.
            SpotlightActivityGroupSearchCriteria activityGroupSearchCriteria =
                new SpotlightActivityGroupSearchCriteria();

            activityGroupSearchCriteria.advertiserId = advertiserId;

            try {
                // Get activity group.
                SpotlightActivityGroupRecordSet recordSet =
                    service.getSpotlightActivityGroups(activityGroupSearchCriteria);

                // Display activity group names and ids.
                if (recordSet.records != null)
                {
                    foreach (SpotlightActivityGroup result in recordSet.records)
                    {
                        Console.WriteLine("Activity group with name \"{0}\" and id \"{1}\" was found.",
                                          result.name, result.id);
                    }
                }
                else
                {
                    Console.WriteLine("No activity groups found for your criteria.");
                }
            } catch (Exception ex) {
                Console.WriteLine("Failed to retrieve activity groups. Exception says \"{0}\"",
                                  ex.Message);
            }
        }