Page 1 of 1
Problems with the DemoClient
Posted: Wed Oct 24, 2012 3:37 am
by grannysmith
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.
Re: Problems with the DemoClient
Posted: Wed Oct 24, 2012 3:41 am
by grannysmith
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;
}
}
}
Re: Problems with the DemoClient
Posted: Wed Oct 24, 2012 10:37 pm
by kamermans
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).
Re: Problems with the DemoClient
Posted: Wed Oct 24, 2012 10:40 pm
by kamermans
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).
Re: Problems with the DemoClient
Posted: Thu Oct 25, 2012 1:45 am
by grannysmith
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.