Quantcast

API-key not working?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

API-key not working?

Andreas Grosam
Hello all,


this is my first post in this list, and also my first attempt to use the Web API.

I apologize if this question has been asked already, but I couldn't search the list for my specific issue.


So here goes:

When I try one of the CloudMade examples using a browser (Firefox) which accesses the API, it works fine:

"http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"

returns the JSON data.

Note, the url request string is copied verbatim from one of the examples given in <http://developers.cloudmade.com/wiki/geocoding-http-api/Documentation>


When I use my own API-key - but otherwise use the same request string,
"http://geocoding.cloudmade.com/<my_own_key>/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"

I got the following error message in the browser:
"Forbidden, no token in query"


It seems, my API-key is not working, which I obtained a few days ago.



Any help is appreciated, thanks in advance!



Regards
Andreas





_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: API-key not working?

Zsombor Szabó
Hey Andreas,

CM has made recently some changes. In short: you need to register
*your* users to the CM web services and supply an additional token as
a parameter. Check out the following doc:

http://developers.cloudmade.com/projects/show/auth

Regards,
Zsombor

On Thu, Feb 4, 2010 at 17:02, Andreas Grosam <[hidden email]> wrote:

> Hello all,
>
>
> this is my first post in this list, and also my first attempt to use the Web API.
>
> I apologize if this question has been asked already, but I couldn't search the list for my specific issue.
>
>
> So here goes:
>
> When I try one of the CloudMade examples using a browser (Firefox) which accesses the API, it works fine:
>
> "http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>
> returns the JSON data.
>
> Note, the url request string is copied verbatim from one of the examples given in <http://developers.cloudmade.com/wiki/geocoding-http-api/Documentation>
>
>
> When I use my own API-key - but otherwise use the same request string,
> "http://geocoding.cloudmade.com/<my_own_key>/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>
> I got the following error message in the browser:
> "Forbidden, no token in query"
>
>
> It seems, my API-key is not working, which I obtained a few days ago.
>
>
>
> Any help is appreciated, thanks in advance!
>
>
>
> Regards
> Andreas
>
>
>
>
>
> _______________________________________________
> Dev site list
> [hidden email]
> http://lists.cloudmade.com/listinfo/dev
>
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: API-key not working?

Nick Black-2
Hi Andreas,

Is your API key mobile or web?  The authentication changes only affect mobile API keys.  API keys can take up to 15 mins to activate - could this be the problem?


On 4 Feb 2010, at 15:07, Zsombor Szabó wrote:

> Hey Andreas,
>
> CM has made recently some changes. In short: you need to register
> *your* users to the CM web services and supply an additional token as
> a parameter. Check out the following doc:
>
> http://developers.cloudmade.com/projects/show/auth
>
> Regards,
> Zsombor
>
> On Thu, Feb 4, 2010 at 17:02, Andreas Grosam <[hidden email]> wrote:
>> Hello all,
>>
>>
>> this is my first post in this list, and also my first attempt to use the Web API.
>>
>> I apologize if this question has been asked already, but I couldn't search the list for my specific issue.
>>
>>
>> So here goes:
>>
>> When I try one of the CloudMade examples using a browser (Firefox) which accesses the API, it works fine:
>>
>> "http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>>
>> returns the JSON data.
>>
>> Note, the url request string is copied verbatim from one of the examples given in <http://developers.cloudmade.com/wiki/geocoding-http-api/Documentation>
>>
>>
>> When I use my own API-key - but otherwise use the same request string,
>> "http://geocoding.cloudmade.com/<my_own_key>/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>>
>> I got the following error message in the browser:
>> "Forbidden, no token in query"
>>
>>
>> It seems, my API-key is not working, which I obtained a few days ago.
>>
>>
>>
>> Any help is appreciated, thanks in advance!
>>
>>
>>
>> Regards
>> Andreas
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dev site list
>> [hidden email]
>> http://lists.cloudmade.com/listinfo/dev
>>
> _______________________________________________
> Dev site list
> [hidden email]
> http://lists.cloudmade.com/listinfo/dev

--
Nick Black
Founder and Head of Products
twitter.com/nick_b

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: API-key not working?

Alexandra-3
Hi Andreas,

You have registered your API key for mobile platform. All new mobile
applications need to use token based authorization. So please use this new
authorization schema, for more details please take a look here
http://developers.cloudmade.com/projects/show/auth .

Or you can register another API key for web platform and use it without
token based authorization for a few months, but then you will need to
migrate in the future to the new authorization schema, so we encourage you
to do it now better.


With best regards,
Alexandra

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nick Black
Sent: Thursday, February 04, 2010 6:58 PM
To: Zsombor Szabó
Cc: [hidden email]
Subject: Re: [CM Dev] API-key not working?

Hi Andreas,

Is your API key mobile or web?  The authentication changes only affect
mobile API keys.  API keys can take up to 15 mins to activate - could this
be the problem?


On 4 Feb 2010, at 15:07, Zsombor Szabó wrote:

> Hey Andreas,
>
> CM has made recently some changes. In short: you need to register
> *your* users to the CM web services and supply an additional token as
> a parameter. Check out the following doc:
>
> http://developers.cloudmade.com/projects/show/auth
>
> Regards,
> Zsombor
>
> On Thu, Feb 4, 2010 at 17:02, Andreas Grosam <[hidden email]>
wrote:
>> Hello all,
>>
>>
>> this is my first post in this list, and also my first attempt to use the
Web API.
>>
>> I apologize if this question has been asked already, but I couldn't
search the list for my specific issue.
>>
>>
>> So here goes:
>>
>> When I try one of the CloudMade examples using a browser (Firefox) which
accesses the API, it works fine:
>>
>>
"http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v
2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>>
>> returns the JSON data.
>>
>> Note, the url request string is copied verbatim from one of the examples
given in
<http://developers.cloudmade.com/wiki/geocoding-http-api/Documentation>
>>
>>
>> When I use my own API-key - but otherwise use the same request string,
>>
"http://geocoding.cloudmade.com/<my_own_key>/geocoding/v2/find.js?query=Herm
annplatz,+Berlin&return_geometry=true"

>>
>> I got the following error message in the browser:
>> "Forbidden, no token in query"
>>
>>
>> It seems, my API-key is not working, which I obtained a few days ago.
>>
>>
>>
>> Any help is appreciated, thanks in advance!
>>
>>
>>
>> Regards
>> Andreas
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dev site list
>> [hidden email]
>> http://lists.cloudmade.com/listinfo/dev
>>
> _______________________________________________
> Dev site list
> [hidden email]
> http://lists.cloudmade.com/listinfo/dev

--
Nick Black
Founder and Head of Products
twitter.com/nick_b

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: API-key not working?

Andreas Grosam
In reply to this post by Zsombor Szabó

On Feb 4, 2010, at 4:07 PM, Zsombor Szabó wrote:

> Hey Andreas,
>
> CM has made recently some changes. In short: you need to register
> *your* users to the CM web services and supply an additional token as
> a parameter. Check out the following doc:
>
> http://developers.cloudmade.com/projects/show/auth
>
> Regards,
> Zsombor
>

Thank you very much, this explains it.

I have a follow up question, though:

If I understood it correctly, for each application (in my case, an application running on a mobile device) there is a unique API-key required.
Furthermore, for each unique user (or more precisely -  in may case, for each unique device) there is a unique token required.

It seems, the API-key can be hard-coded in the Application. The token, however, needs to be obtained when the user starts the application - at least at the very first time.

First question:
Can I assume, that I will get the same token ID when I request it a second time, provided I provide the same user-ID (say a hash from the unique device ID and the API-key)?
(The reason is, to figure out whether the token-ID needs to be stored persistently on the device, or if I can retrieve it each time when the application starts)

Second question is regarding the pricing conditions/terms of use:
Assuming "Mobile Use":

There are two different pricing packages, Standard and Premier. Are these bound to the account, or to a certain API-key?

I didn't do anything special to activate Standard or Premier pricing package. What do I get on a freshly created account, and how do I possibly get Premier package?

What does this mean "First 5000 users per month free"? Are this the number of unique users per month with at least one access to CM services? I'm asking because, there could be possible many times more unique users, or even more accesses - but I don't understand the "per month" term.

And finally, what happens when a user (of my mobile application on his device) attempts to access the service and the "free use" of my account is exceeded?



Thank you again for answering these question!



Regards,
Andreas

> On Thu, Feb 4, 2010 at 17:02, Andreas Grosam <[hidden email]> wrote:
>> Hello all,
>>
>>
>> this is my first post in this list, and also my first attempt to use the Web API.
>>
>> I apologize if this question has been asked already, but I couldn't search the list for my specific issue.
>>
>>
>> So here goes:
>>
>> When I try one of the CloudMade examples using a browser (Firefox) which accesses the API, it works fine:
>>
>> "http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>>
>> returns the JSON data.
>>
>> Note, the url request string is copied verbatim from one of the examples given in <http://developers.cloudmade.com/wiki/geocoding-http-api/Documentation>
>>
>>
>> When I use my own API-key - but otherwise use the same request string,
>> "http://geocoding.cloudmade.com/<my_own_key>/geocoding/v2/find.js?query=Hermannplatz,+Berlin&return_geometry=true"
>>
>> I got the following error message in the browser:
>> "Forbidden, no token in query"
>>
>>
>> It seems, my API-key is not working, which I obtained a few days ago.
>>
>>
>>
>> Any help is appreciated, thanks in advance!
>>
>>
>>
>> Regards
>> Andreas
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dev site list
>> [hidden email]
>> http://lists.cloudmade.com/listinfo/dev
>>

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: API-key not working?

Andreas Grosam
In reply to this post by Alexandra-3


On Feb 4, 2010, at 6:42 PM, Alexandra wrote:

> Hi Andreas,
>
> You have registered your API key for mobile platform. All new mobile
> applications need to use token based authorization. So please use this new
> authorization schema, for more details please take a look here
> http://developers.cloudmade.com/projects/show/auth .
>
> Or you can register another API key for web platform and use it without
> token based authorization for a few months, but then you will need to
> migrate in the future to the new authorization schema, so we encourage you
> to do it now better.
>
>
> With best regards,
> Alexandra
>

Thank you very much Alexandra for the reply.

My plan is to use CM services on mobile devices. For now, I'm only testing it - and this may happen on a mobile test device and of course on the developer platform, which is a desktop.

What kind of API-key do you suggest for testing only? I have no problem with generating a UserID for this purpose, in order to get a token and construct a url accordingly, which I can use as if it were a mobile device.


_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: API-key not working?

Jim Brown-14
You can register a second API-Key as web (attached to the same user account...).

Even in a desktop simulator, if you are using the mobile SDKs, it should get and use tokens properly...  it is only if you are testing specific http requests in a browser that you should need to use a test key.

Hope this helps,



Jim

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Andreas Grosam
Sent: 04 February 2010 17:56
To: [hidden email]
Subject: Re: [CM Dev] API-key not working?



On Feb 4, 2010, at 6:42 PM, Alexandra wrote:

> Hi Andreas,
>
> You have registered your API key for mobile platform. All new mobile
> applications need to use token based authorization. So please use this new
> authorization schema, for more details please take a look here
> http://developers.cloudmade.com/projects/show/auth .
>
> Or you can register another API key for web platform and use it without
> token based authorization for a few months, but then you will need to
> migrate in the future to the new authorization schema, so we encourage you
> to do it now better.
>
>
> With best regards,
> Alexandra
>

Thank you very much Alexandra for the reply.

My plan is to use CM services on mobile devices. For now, I'm only testing it - and this may happen on a mobile test device and of course on the developer platform, which is a desktop.

What kind of API-key do you suggest for testing only? I have no problem with generating a UserID for this purpose, in order to get a token and construct a url accordingly, which I can use as if it were a mobile device.


_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error when invoking addSearchTask

Rob McQualter
Hi guys.

I'm getting an error whenever invoking addSearchTask on the GeocoderManager.

Here's my setup code:

        id cmTilesource = [[RMCloudMadeMapSource alloc] initWithAccessKey:API_KEY styleNumber:1];
    [[[RMMapContents alloc] initWithView:mapView tilesource: cmTilesource] autorelease];
       
        geocoder = [[GeocoderManager alloc] initWithApikey:API_KEY searchFor:nil];
        geocoder.delegate = self;

Then later I call (within a SearchBarDelegate function):

        [geocoder addSearchTask:[lSearchBar text]];


After a delay (I'm guessing, then, that the search results have been received), I receive the following error in the console:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AddCustomLocationViewController dd_invokeOnMainThread]: unrecognized selector sent to instance 0x72223e0'
*** Call stack at first throw:
(
        0   CoreFoundation                      0x02d9cb99 __exceptionPreprocess + 185
        1   libobjc.A.dylib                     0x02eec40e objc_exception_throw + 47
        2   CoreFoundation                      0x02d9e6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
        3   CoreFoundation                      0x02d0e2b6 ___forwarding___ + 966
        4   CoreFoundation                      0x02d0de72 _CF_forwarding_prep_0 + 50
        5   WakeMeUpAnywhere                    0x0005bd9a -[GeocoderManager search] + 1145
        6   Foundation                          0x0010b76c -[NSThread main] + 81
        7   Foundation                          0x0010b6f8 __NSThread__main__ + 1387
        8   libSystem.B.dylib                   0x9500381d _pthread_start + 345
        9   libSystem.B.dylib                   0x950036a2 thread_start + 34


Have I omitted anything in the setup?

Thanks for your help.

Rob McQualter.

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error when invoking addSearchTask

dgolub
Hi Rob,

Please take a look at this post http://support.cloudmade.com/forums/iphone-sdk/posts/137/show in CloudMade support forum. It should help you to solve the problem.

Best regards,
Dmytro  

On Fri, Sep 17, 2010 at 6:29 AM, Rob McQualter <[hidden email]> wrote:
Hi guys.

I'm getting an error whenever invoking addSearchTask on the GeocoderManager.

Here's my setup code:

       id cmTilesource = [[RMCloudMadeMapSource alloc] initWithAccessKey:API_KEY styleNumber:1];
   [[[RMMapContents alloc] initWithView:mapView tilesource: cmTilesource] autorelease];

       geocoder = [[GeocoderManager alloc] initWithApikey:API_KEY searchFor:nil];
       geocoder.delegate = self;

Then later I call (within a SearchBarDelegate function):

       [geocoder addSearchTask:[lSearchBar text]];


After a delay (I'm guessing, then, that the search results have been received), I receive the following error in the console:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AddCustomLocationViewController dd_invokeOnMainThread]: unrecognized selector sent to instance 0x72223e0'
*** Call stack at first throw:
(
       0   CoreFoundation                      0x02d9cb99 __exceptionPreprocess + 185
       1   libobjc.A.dylib                     0x02eec40e objc_exception_throw + 47
       2   CoreFoundation                      0x02d9e6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
       3   CoreFoundation                      0x02d0e2b6 ___forwarding___ + 966
       4   CoreFoundation                      0x02d0de72 _CF_forwarding_prep_0 + 50
       5   WakeMeUpAnywhere                    0x0005bd9a -[GeocoderManager search] + 1145
       6   Foundation                          0x0010b76c -[NSThread main] + 81
       7   Foundation                          0x0010b6f8 __NSThread__main__ + 1387
       8   libSystem.B.dylib                   0x9500381d _pthread_start + 345
       9   libSystem.B.dylib                   0x950036a2 thread_start + 34


Have I omitted anything in the setup?

Thanks for your help.

Rob McQualter.

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev


_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error when invoking addSearchTask

Rob McQualter
That's great.

I incorrectly had "-add_load" as a linker flag rather than "-all_load", simple typo.

Thanks for the timely help.

Rob.

On 17/09/2010, at 4:39 PM, Dmytro Golub wrote:

Hi Rob,

Please take a look at this post http://support.cloudmade.com/forums/iphone-sdk/posts/137/show in CloudMade support forum. It should help you to solve the problem.

Best regards,
Dmytro  


_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Loading...