Problem with getting Admin Key in Geofencing API

I am trying to use the Geofencing API to get the admin key, so I typed in the link provided which is
https://api.tomtom.com/geofencing/1/register?key=myKEY
and I am getting this error:
{“message”:“Malformed request”}
Does anyone know what I am doing wrong or how to fix it?

1 Like

Hi,
did you use POST and provided your secret (a.k.a. passphrase you’ll use if you want to regenerate secret in the future) in the payload of the request?

In general registering for admin key should look like this:

curl -XPOST "Content-type: application/json" -d
'{
   "secret": "secret_passphrase_of_your_choosing"
 }'
'https://api.tomtom.com/geofencing/1/register?key=Your_API_Key'
3 Likes

How do I use the web to do that though? I am trying to search it in google using the link. I can’t search using the whole Post expression.

I hope I got your question right - you are asking how to use POST in Http requests, am I correct?

First things first - what is a POST Http request?
POST Http method according to Mozilla:

The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

How to use it?
You need to have a tool - web browser won’t be enough. You can use, among many, tools like:

You can also use a library for your favorite programming language:

Hope it helps :slight_smile:
Best Regards,
Piotr

1 Like

Thanks, this is helpful. Do any of these tools work well with android studio, that is what I am developing in. If so, which works the best?

Thanks,
Tucker

Since you develop for Android I’d suggest getting familiar with Retrofit library, as it’s a HTTP client designed specifically for Android and Java.

-Piotr

Hi I am getting an error Developer Unknown Referer in Postman.
Admin key is not getting generated

Hi,
could you please provide steps to reproduce (without your personal keys, passphrases, etc.) and the exact response message you get?
-Piotr

Unknown referrer may be returned if you are using domain whitelisting. In Postman you can just add header Referrer with a value of your site address.