I am working on android app which uses google's places autocomplete API.
When tried to hit following URL
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&types=geocode&sensor=false&language=en&key=apiKey
I got the response as below.
{
"predictions" : [],
"status" : "REQUEST_DENIED"
}
I got the API key from link below
Google APIs console
also i have enabled Google Maps API v3 service.
As per API documentation REQUEST_DENIED response is generally due to lack of sensor parameter but which i have already provided.
After hitting above URL directly in browser also i am getting REQUEST_DENIED response.
Is anything else i have to do?
Are you sure your key is correct and that you have enough quota left? Try generating a new key and checking that you have the referrals correct/set to empty.
You also may need to wait up to 5 minutes for the key to become active.
FWIW I tested your URL with my own key and it worked fine.
I was also facing the same issue "REQUEST_DENIED" when using google places API for my android app. As per Google API console help "Android and iOS keys are only supported by some APIs, such as the Google Maps Android API or the Google Maps SDK for iOS." (https://developers.google.com/console/help/).
In my case problem solved by using the 'key for bowser apps' instead of using android/iOs keys.
I dont see input parameter listed on API page http://code.google.com/apis/maps/documentation/places/#PlaceSearches
What does it do? If you really need to have it, try moving it to the last item. Or just try removing it first to see if it works.
The problem that you are facing is may be related to API_KEY.You inserted something like
letter "l" instead of capital "i". Capital i and el(l) looks same in the xcode
environment.Try to insert correct letter will solve the issue.
Related
I'm trying to provision a device with QR code method according to these documentations.
I'm using this Google collab quickstart guide to do so.
Right now, I'm stuck here:
enrollment_token = androidmanagement.enterprises().enrollmentTokens().create(
parent=enterprise_name,
body={
"policyName": policy_name,
"qrCode": "{'android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME': 'com.tmp.app.admin/.AdminReceiver','android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM': 'MUQ6NEQ6MDQ6NTY6M0E6ODA6Mzg6NEY6NUM6ODI6Qzk6NUY6MkM6QjA6RTk6RDc6QTM6RjI6NDg6NTA6QTQ6RjY6QTA6RjM6MTA6NUM6MzI6NkY6QkU6NUI6M0E6Qzk%3D','android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION':'https://myurl-stuff.com/link_part/my_app.apk','android.app.extra.PROVISIONING_SKIP_ENCRYPTION': false,'android.app.extra.PROVISIONING_WIFI_SSID': 'MY_WIFI_SSID','android.app.extra.PROVISIONING_WIFI_PASSWORD': 'my_wifi_password','android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE': 'WPA'}"
}
).execute()
json.dumps(enrollment_token, indent=2)
Whenever I run this code, the output is the following.
{\n "name": "enterprises/LC00y54m79/enrollmentTokens/UV4yLfxoyWSln7CArwtp7OJQiHH_Gvc76JttPa4-r48",\n "value": "ZBNWPOWHBQUPNLMBTNRU",\n "expirationTimestamp": "2023-02-06T12:43:34.634467Z",\n "policyName": "enterprises/LC00y54m79/policies/policy1",\n "qrCode": "{\\"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME\\":\\"com.google.android.apps.work.clouddpc/.receivers.CloudDeviceAdminReceiver\\",\\"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM\\":\\"I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg\\",\\"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION\\":\\"https://play.google.com/managed/downloadManagingApp?identifier=setup\\",\\"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE\\":{\\"com.google.android.apps.work.clouddpc.EXTRA_ENROLLMENT_TOKEN\\":\\"ZBNWPOWHBQUPNLMBTNRU\\"}}"\n}
It is the default Google example and it does not contains my application, instead, it contains Google's official example app.
What am I doing here wrong?
EDIT:
I have syntax error with double quotes.
EDIT 2:
Also tried with starting and ending single quotes like:
'{"android.app.extra (...)
Also tried with starting and ending with triple quotes like in Google's previous example like here:
But still no luck.
The api either returns a syntax error or simple doesn't returns with my app/parameters in the qrCode, instead it replaces to their own example project.
EDIT 3:
Tried like this:
But with no success:
There are two ways to manage devices :
Provision a device with your own DPC : Your DPC is installed (referenced by an URL in the QR code). It fetches policies from your servers and applies them as a profile / device owner, without using any Google API (Android only).
Manage devices using Google Play EMM API. It is basically Google's layer on top of the Android API (but often called Android Management API, which is a bit confusing) : Your EMM console send policies to Google's servers. They are applied on the devices by Google's own DPC.
You are trying to mix the two approaches. It is no longer possible :
Android Enterprise is no longer accepting new registrations for custom device policy controllers (DPC) using the Google Play EMM API.
All new EMM solutions should now use Android Management API, which comes with its own DPC provided by Google.
The Google DPC is the com.google.android.apps.work.clouddpc you are seeing in the generated QR code.
If you want to use you own DPC, you need to use the json containing the android.app.extra.PROVISIONING* keys directly, without wrapping it in a Google token.
The content looks fine except the SSID has to be quoted, and the signature hash should not be percent encoded :
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.tmp.app.admin/.AdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://myurl-stuff.com/link_part/my_app.apk",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "MUQ6NEQ6MDQ6NTY6M0E6ODA6Mzg6NEY6NUM6ODI6Qzk6NUY6MkM6QjA6RTk6RDc6QTM6RjI6NDg6NTA6QTQ6RjY6QTA6RjM6MTA6NUM6MzI6NkY6QkU6NUI6M0E6Qzk=",
"android.app.extra.PROVISIONING_SKIP_ENCRYPTION": false,
"android.app.extra.PROVISIONING_WIFI_PASSWORD": "my_wifi_password",
"android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE": "WPA",
"android.app.extra.PROVISIONING_WIFI_SSID": "\"MY_WIFI_SSID\""
}
You just have to generate a QR code containing this content (with any generator), and scan it with the device.
Unfortunately the provisioning process is not forgiving. If something is wrong, the device shows a "Provisionning failed" error message without any clue. You have to triple check everything.
I am getting this error from Play Store:
I tried to limit the access of API key within that file but still getting this error. How can I solve this?
Make sure that keys are not leaked via sites such as GitHub.
Notice the message wording "Your app contains exposed ...". That message did not say your app is exposing the keys.
You will need to delete the key and create a new key, update your app, etc.
Delete current key and create new one. Also make sure you apply restrictions like HTTP referrers, IP Address restrictions etc. based on your use case. For more info, check this
https://cloud.google.com/docs/authentication/api-keys#api_key_restrictions
The error is due to the API key being included in your source code. Consider using Google's Secrets Gradle Plugin for Android to hide your API keys from source code. Documentation at https://github.com/google/secrets-gradle-plugin and demo by the author at https://youtu.be/X8lYNW_Or2o
I need to use "nearby search" in my app. So I have opened a new api key specifically for Places Api. (the regular Places api, not the Android one) and it worked perfectly for a short time.
However, suddenly I started receiving OVER_QUERY_LIMIT error. I tried replacing the api key with a new one, but that doesn't help. I even tried opening a new project.. still didn't help.
The reason you are getting that error message is because you have used up all your API requests and passed over your quota
From the Documentation it says: "OVER_QUERY_LIMIT" indicates that you are over your quota.
Source: https://developers.google.com/maps/documentation/geocoding/intro#StatusCodes
Is it possible to get the "Popular times" information through the Google Places API or any other API? I need this information to be displayed in my application for a particular place.
This is one of the top feature requests in Google issue tracker (more than 500 stars):
https://issuetracker.google.com/issues/35827350
Currently, the state is Assigned, however, no any ETA provided by Google. Please star it to get further updates.
I haven't managed to test it myself but this is what populartimes offers to do in Python:
import populartimes
populartimes.get("your-api-key", ["bar"], (48.132986, 11.566126), (48.142199, 11.580047))
More info on developer's github.
It's possible to scrape it, but it violates the Google ToS.
yes its possible but as said it violates googles ToS ,
i have used npm package busy-hours but it's not working so i have modified their code and here is new npm package
https://www.npmjs.com/package/google-busy-hours
I need to implement Ola cabs Api in an android app. I am following this link - http://docs.console.olacabs.com/ola.
But everytime I try and fetch some data, it says "Authorization Error". I need a valid Api key to use the services but can't find a way or link to generate one.
try #ndo1d
http://blog.attify.com/2015/02/01/ola-cabs-privacy-security-issue-discovered-appwatch/
https://medium.com/#CodeTheDevil/busting-ola-wallet-1ceea6174b1f
You can use the application normally, and AppWatch will show you the real time application’s network traffic. AppWatch is an intelligent platform, with which it automatically identifies APIs which could be vulnerable. As soon the app does something which AppWatch identifies to be vulnerable, it simply displays a vulnerable tag along with the request.
Usually you have to insert an API Key in the header of the request to access API's functions.
I don't know exactly if it's the case, or if you have generated the API Key, if this key has authorization to access the resource you want.
Please check: Do you have an API Key? Does it provide access to what resources?
ps: I can't comment. That's why I wrote an answer.
Register here to get API Key..
https://developers.olacabs.com/docs/ride-availablity