Google Civic Information API `/voterInfoQuery` route returning 400 - google-civic-information-api

When testing the API at this site (https://developers.google.com/civic-information/docs/v2/elections/voterInfoQuery) I only receive a 400 response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Election unknown"
}
],
"code": 400,
"message": "Election unknown"
}
}
is this API still supported?

Yes, the API is still supported. Did you resolve the issue?
If not, make sure you're putting in a valid number for the electionId (2000 should work).

Related

How to make an HTTP call to YouTube Analytics API?

I want to get information about top keywords driving traffic to my own YouTube channel over the past 7 days. In order to do that, I followed all of the instructions. Then I generated a new access_token for my account
When I make such a request:
curl -X GET \
'https://youtubeanalytics.googleapis.com/v2/reports?dimensions=insightTrafficSourceDetail;7DayTotals&metrics=views&filters=insightTrafficSourceType==YT_SEARCH;channel==MINE&maxResults=10&sort=-views' \
-H 'Authorization: Bearer access_token'
I receive back an error:
"error": {
"code": 400,
"message": "Required",
"errors": [
{
"message": "Required",
"domain": "global",
"reason": "required"
}
]
}
}
What I do wrong when construct this kind of request?
"error": {
"code": 400,
"message": "Required",
"errors": [
{
"message": "Required",
"domain": "global",
"reason": "required"
}
]
}
Is basically a really bad error message telling that you are missing a required field.
If you check the Documentation you will notice that startdate and enddate are required fields. You have forgotten to add them to your request
Also when you get that far you separate dimensions and metrics with a , not a ;
So the problem was in query params, which I set incorrectly. Here is how the URL should be formed in order to get the data from the question:
https://youtubeanalytics.googleapis.com/v2/reports?dimensions=insightTrafficSourceDetail&metrics=views&filters=insightTrafficSourceType==YT_SEARCH&maxResults=10&sort=-views&startDate=2019-07-03&endDate=2019-07-10&ids=channel==MINE

Google Plus Domains Api insert Activities in error

I try to create activity through the form 'Google+ Domains API v1' with 'plusDomains.activities.insert'
I use scopes :
https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/plus.stream.write
Request is : https://www.googleapis.com/plusDomains/v1/people/me/activities?preview=true&fields=access&key={YOUR_API_KEY}
parameters :
{
"object": {
"originalContent": "Test"
},
"access": {
"items": [
{
"type": "domain"
}
],
"domainRestricted": true
}
}
but I have the following error :
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
and I have this message :
You do not have permission to execute this method.
This API call requires OAUTH2.0 authorization not an API key. That's the reason you're getting the error.
It's clearly stated in Activities.insert:
"Requires authorization"
To prove this, give the Try-it a go. It uses OAuth2. Your request should work.

I am getting an error while using the google custom search api

{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
However the quotas page shows that i have only used 8 queries while the limit is 100

Create and Share bucket in google cloud storage using google api's

i need to create and share a bucket in gcloud storage using google api's. but i got an error when am tring with postman(rest client).
Iam trying with
url
-------
https://www.googleapis.com/storage/v1/b?project=testproject
request body
------------
{
"name":"testbucketmanafnew"
}
i got an error
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
after iam created an access tocken using OAuth 2.0 Playground. And added to header
Authorization = ya29.VALUE_REDACTED
But i got error
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
what did i miss?
using Google api explorer, am able to call api's successfully
POST https://www.googleapis.com/storage/v1/b?project=testproject&key={YOUR_API_KEY}
{
"name": "testmanafcjbucketyy"
}
Authorization needs to be passed in the following format.
Authorization: Bearer [oauth2_token]
if you're using Postman the "Header" field becomes Authorization and the "Value" field becomes Bearer[WHITESPACE][oauth2_token]

https://usercontent.googleapis.com/freebase/v1/imageID return "Domain Type Forbidden"

https://usercontent.googleapis.com/freebase/v1/image/en/jenni_rivera
https://usercontent.googleapis.com/freebase/v1/image/en/bob_dylan
return
{
"error": {
"errors": [
{
"domain": "global",
"reason": "domainTypeForbidden",
"message": "Domain Type Forbidden"
}
],
"code": 403,
"message": "Domain Type Forbidden"
}
}
Do i do somthing wrong? API was changed?
Yes, we're looking into it. Right now the images are available from:
https://www.googleapis.com/freebase/v1/image/en/jenni_rivera
...but it should be switched back to usercontent.googleapis.com very soon.

Resources