No API key was provided

andrewvbe
Posts: 2
Joined: Mon Apr 20, 2015 9:07 pm

No API key was provided

Postby andrewvbe » Mon Apr 20, 2015 9:27 pm

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

Elliotfehr

Re: No API key was provided

Postby Elliotfehr » Tue Apr 21, 2015 9:14 am

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

andrewvbe
Posts: 2
Joined: Mon Apr 20, 2015 9:07 pm

Re: No API key was provided

Postby andrewvbe » Tue Apr 21, 2015 6:26 pm

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;
}

support-all
Posts: 32
Joined: Mon Oct 08, 2012 2:47 am

Re: No API key was provided

Postby support-all » Thu Apr 23, 2015 6:15 am

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.

Code: Select all

using ScientiaMobile.WurflCloud.Request;


var wurflRequest = new WurflCloudRequest(context);
var info = manager.GetDeviceInfo(context);
instead of

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" });
Regards

Beppe


Who is online

Users browsing this forum: No registered users and 4 guests