Problems with the DemoClient

grannysmith
Posts: 3
Joined: Wed Oct 24, 2012 3:28 am

Problems with the DemoClient

Postby grannysmith » Wed Oct 24, 2012 3:37 am

Hi,

I downloaded the Cloud API for ASP.NET 2.x / 3.x ( http://www.scientiamobile.com/api_downl ... otNet2.zip ).

In the "DemoClient" project i adjusted the API key and the capabilities to match those configured in our account.

However, when i run the DemoClient and click on "Detect current device" I always get a 401 Error (see screenshot)

Any help would be appreciated.
Attachments
Clipboard02.png
Clipboard02.png (15.23 KiB) Viewed 11338 times

grannysmith
Posts: 3
Joined: Wed Oct 24, 2012 3:28 am

Re: Problems with the DemoClient

Postby grannysmith » Wed Oct 24, 2012 3:41 am

Here's the code I used:

Code: Select all

using System.Web;
using ScientiaMobile.WurflCloud;
using ScientiaMobile.WurflCloud.Config;

namespace DemoClient_Base.Framework
{
	public class WurflService
	{
		public DeviceInfoViewModel GetDataByRequest(HttpContext context)
		{
			var config = new DefaultCloudClientConfig
			{
				ApiKey = "<our api key>"
			};

			var manager = new CloudClientManager(config);
			
			// Grab data
			var info = manager.GetDeviceInfo(context, new[] { "is_wireless_device", "is_smartphone", "is_tablet" });

			var model = new DeviceInfoViewModel
							{
								DeviceId = info.Id,
								ServerVersion = info.ServerVersion,
								DateOfRequest = info.WurflLastUpdate.ToString(),
								Library = manager.GetClientVersion(),
								Capabilities = info.Capabilities,
								Errors = info.Errors,
								Source = info.ResponseOrigin
							};

			return model;
		}
	}
}

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Problems with the DemoClient

Postby kamermans » Wed Oct 24, 2012 10:37 pm

Hi,

I have looked into your account and I see that you have two API keys. Both of these keys are working fine from our tests. It's possible that you're faster at programming than our service is at syncing new API keys (5 mins or so, max) :) Were you able to get connected? Please ensure you are copying the entire API key (6 digits, ":", then 32 chars).
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Problems with the DemoClient

Postby kamermans » Wed Oct 24, 2012 10:40 pm

Also, please ensure your server is able to make outgoing connections to *.wurflcloud.com. If you need specific hosts, you can whitelist the IPs for api.wurflcloud.com, us.wurflcloud.com, uk.wurflcloud.com and za.wurflcloud.com, although this is discouraged because they are subject to change (very rarely).
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

grannysmith
Posts: 3
Joined: Wed Oct 24, 2012 3:28 am

Re: Problems with the DemoClient

Postby grannysmith » Thu Oct 25, 2012 1:45 am

kamermans wrote:It's possible that you're faster at programming than our service is at syncing new API keys (5 mins or so, max) :)
Without changing anything it works now, so it was probably something like that. The problem persisted for more than 5 minutes though.

Thanks for your help.


Who is online

Users browsing this forum: No registered users and 12 guests