Just registered today and am trying to get the .Net demo working. I am getting the error "No API key was provided" when making the call to GetDeviceInfo. Waited a couple hours for the key to propagate, still no luck.
I can ping api.wurflcloud.com.
at ScientiaMobile.WurflCloud.Http.CloudClient.SendRequestFromUserAgentOnly(String url)
at ScientiaMobile.WurflCloud.Http.CloudClient.SendRequest(HttpContextBase context, String url, Boolean uaMayBeDifferent)
at ScientiaMobile.WurflCloud.CloudClientManager.DetectDevice(String userAgent, Dictionary`2 reqParams, String[] capabilities)
at ScientiaMobile.WurflCloud.CloudClientManager.GetDeviceInfo(String userAgent, String[] capabilities)
at CloudDemoBase.Services.Home.WurflService.GetDataByRequest(HttpContextBase context) in d:\ASU\CSE 598 Web
No API key was provided
Re: No API key was provided
Hello,
Are you able to provide me with a sample of your code to see how you are configuring the WURFL cloud client?
Thank you,
Elliot
Are you able to provide me with a sample of your code to see how you are configuring the WURFL cloud client?
Thank you,
Elliot
Re: No API key was provided
I am using the sample code from your website.
public DeviceInfoViewModel GetDataByRequest(HttpContextBase context)
{
var config = new DefaultCloudClientConfig
{
ApiKey = "699083:z40ORAIC17eEGnT8DcM9alqSxUtK6isj"
};
var manager = new CloudClientManager(config);
// Grab data
const String ua = "Mozilla/5.0 (Linux; U; Android 5.4; en-us; Nexus 4 Build/JOP40C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
var info = manager.GetDeviceInfo(ua, new[] { "is_wireless_device", "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;
}
public DeviceInfoViewModel GetDataByRequest(HttpContextBase context)
{
var config = new DefaultCloudClientConfig
{
ApiKey = "699083:z40ORAIC17eEGnT8DcM9alqSxUtK6isj"
};
var manager = new CloudClientManager(config);
// Grab data
const String ua = "Mozilla/5.0 (Linux; U; Android 5.4; en-us; Nexus 4 Build/JOP40C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
var info = manager.GetDeviceInfo(ua, new[] { "is_wireless_device", "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;
}
-
- Posts: 32
- Joined: Mon Oct 08, 2012 2:47 am
Re: No API key was provided
Hi,
I'm the .NET engineer of ScientiaMobile.
When you want to use an explicit user-agent, you have to choose and set the two available capabilities from your account page.
Try to use this sample code based on your default request to test the Cloud.
instead of
Regards
Beppe
I'm the .NET engineer of ScientiaMobile.
When you want to use an explicit user-agent, you have to choose and set the two available capabilities from your account page.
Try to use this sample code based on your default request to test the Cloud.
Code: Select all
using ScientiaMobile.WurflCloud.Request;
var wurflRequest = new WurflCloudRequest(context);
var info = manager.GetDeviceInfo(context);
Code: Select all
const String ua = "Mozilla/5.0 (Linux; U; Android 5.4; en-us; Nexus 4 Build/JOP40C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
var info = manager.GetDeviceInfo(ua, new[] { "is_wireless_device", "is_tablet" });
Beppe
Who is online
Users browsing this forum: No registered users and 4 guests