Google vision API rest integrartion - vision

I am using trail version of google vision API ,using the rest API i am trying to get the face_detection values from postman tool but i am facing an issue showed below.can anyone help me on this.
"message": "Requests from referer chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop are blocked.",
"status": "PERMISSION_DENIED",

Try using the native Postman App. The Chrome app adds the "referer" header to every request it sends out.
Alternatively, you can try enabling the Interceptor, which will send requests through your browser, instead of through Postman.

Related

Using Postman to test KOHA RestAPI but keep getting authentication failure

I have a problem working with Postman and Koha RestAPI to display desired input.
I want to try GET request on Postman using this URL as endpoint: https://{KOHADomain}/api/v1/patrons?userid={userid}.
What supposed to happen is the output should display all patrons detail in json or xml, but I keep getting this message:
{
"error": "Authentication failure."
}
The url works fine in the browser after login using KOHA privilege account. It displays all the desired output in xml form, but not in Postman.
The methods that I have tried:
Clear browser's cache.
Re-login Koha account.
Use Basic Auth.
Use OAuth 2.0. (client_id, secret_key, Token Access URL)
I really appreciate if someone could help me find the solution for this problem.

Twitter Search API query with hashtag returning returning "Could not authenticate you”,”code”:32

I have scoured the web to try and find an answer to what seems to be a simple solution but unable to come across one.
I am using Postman. On the Authorisation tab, I have entered the details as defined in the Twitter Application Management.
In the header, I have a key of Authorization and value of
OAuth oauth_consumer_key="my-consumer-key",
oauth_token="my-consumer-token",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1538075001",
oauth_nonce="zXeiLqV5GzK",
oauth_version="1.0",
oauth_signature="SYdcrIrRT6jdgo57b1qP9a9THcc%253D"
When I run a GET request for https://api.twitter.com/1.1/search/tweets.json?q=test I get the expect results.
However, trying to search for a hashtag
https://api.twitter.com/1.1/search/tweets.json?q=%23test&include_entities=true I get the following in the response body
{
"errors": [
{
"code": 32,
"message": "Could not authenticate you."
}
]
}
with a status of 401: Authorization Required
Why would this be the case, would there be a step I missed in setting up or can you not search for hashtags on the free version?
Any help would be appreciated.
Solution is to use OAuth2
Twitter OAuth1 seems to have issue with url encoding.
I ended up using OAuth2 too. Requesting Bearer's Token to https://api.twitter.com/oauth2/token and giving it App Consumer API keys as authorization credentials.
Reference can be found here

Youtube data api return dailyLimitExceededUnreg reach

We are using the YouTube Data API to get the YouTube channel information, it was working before two days now it is giving me below error:
{
"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."
}
}
Is there any new update on YouTube Data API?
Can anyone help me to resolve this issue?
In order to access any Google API you need to identify your application. This rule has not been enforced on all Google APIs. If you say your request has worked in the past I suspect that they have begun to enforce this now with the YouTube API.
The problem is that you have either not authenticate your application using Oauth2 or you are not sending an API key along with this request.
You need a Google Account to access the Google Developers Console, request an API key, and register your application.
Create a project in the Google Developers Console and obtain authorization credentials so your application can submit API requests.
After creating your project, make sure the YouTube Data API is one of the services that your application is registered to use:
a. Go to the Developers Console and select the project that you just registered.
b. Open the API Library in the Google Developers Console. If prompted, select a project or create a new one. In the list of APIs, make sure the status is ON for the YouTube Data API v3.
If your application will use any API methods that require user authorization, read the authentication guide to learn how to implement OAuth 2.0 authorization.
see Getting started
I was getting the same error. The mistake I was making is not setting the API Key value while requesting. Please set the API Key attribute.
If you are using youtube data v3 api use following code snippet.
playlistItemsListByPlaylistIdRequest.setKey(YOUR_API_KEY_VALUE);
If you are using the Html request, then use following format :
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=8&playlistId={PLAYLIST_ID}&key={YOUR_API_KEY}

Youtube API with AFNetworking failed

I am trying to use the Youtube API to pull in all the videos from a particular channel. I set up the project in Google Developers Console and got an API browser key. I enabled YouTube Data API v3 and for safe measure, I enabled YouTube Analytics API.
I do not know what I am getting this error. Can anyone help me. This is my console output.
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.",
"extendedHelp": "https://console.developers.google.com"
}
],
"code": 403,
"message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed."
}
Did you add any bundle id's to "Edit allowed iOS apps..." in your API Access panel? If you did, remove them all. iOS apps: should now say "Any app allowed". This fixed this issue for me.
I am told that this is fixed by simply removing all Ip's from the edit allowed IP's option. This makes it so that it is less secure, but it will accept all IP's after that.

Twitter API - GET search/tweets for hashtag returns "Could not authenticate you"

I'm using Postman to make GET requests from the Twitter API, but having some quirky issues when using search/tweets for a particular hashtag. My goal is to return a list of recent tweets that have the same #hashtag. I'm following along with Twitter's instructions on how to do this, which can be found here (look under the header 'Query Parameters').
This returns the below JSON response
GET https://api.twitter.com/1.1/search/tweets.json?q=%23somehashtag
{
"errors": [
{
"message": "Could not authenticate you",
"code": 32
}
]
}
I'm using OAuth 1.0, also based on Twitter's docs. I can make successful calls to the same endpoint by simply removing the %23:
GET https://api.twitter.com/1.1/search/tweets.json?q=somehashtag
Since you use OAuth 1.0 this suggests the the code that generates the signature does not correctly include the %23 in the payload that is signed. Switching to OAuth 2.0 will make sending authorized requests easier and future proof.
Just need to encode the #. Don't need to go to OAuth2
var url="https....?q="+encodeURIComponent("#hashtag")
and it should work for you.
I am facing the same issue with POSTMAN, and it seems like a bug
I've found this in a different scenario
GET parameters that have been URL encoded need to be decoded before adding to oAuth.
https://github.com/J7mbo/twitter-api-php/pull/112
it seems there is no way to tell postman to not encode, but in my code it just works
Responding to an old post , but using Bearer Token on Postman is working for me to resolve this authorization issue ( code 32) of using #hashtag in query
https://api.twitter.com/1.1/search/tweets.json?q=%23somehastag&result_type=recent

Resources