Google Video Intelligence operation - google-cloud-platform

I tried the demo at https://cloud.google.com/video-intelligence/
If I switch to the API tab I can see the request is
https://videointelligence.googleapis.com/v1/operations/projects/4808913407/locations/us-east1/operations/12700896084805575820?key=YOUR_API_KEY_HERE
However, when I try doing the same operation using my API key I get
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
Do I need to configure the API key in any specific way to get this working?

Video Intelligence does not support API Keys, you need to authenticate using a service account. Here you can find the list of GCP services that support API Keys.
Here you can find a description step-by-step on how to use video intelligence using the command line.
As you can see you need to generate a print access token after configuring your service account credentials. Then you include it in the API call as "Authorization: Bearer". You cannot use an API key.

Related

Instagram API Get Media Comments

I have my own Instagram Access Token. How can I read the comments on my Media?
I tried to use the Instagram graph API but it gives me an error.
Documentation - https://developers.facebook.com/docs/marketing-api/reference/instagram-media/comments/
Endpoint - https://graph.facebook.com/{my-media-id}/comments
{
"error": {
"message": "Invalid OAuth access token.",
"type": "OAuthException",
"code": 190,
"fbtrace_id": "AZFkVLSyEpT8lSkHT-47_CF"
}
}
Any help is much appreciated
First thing, you can access data through graph API only if your instagram account is a business account/creator account. If you have one of them, then below is the endpoint to use:
https://graph.facebook.com/v12.0/{media-id}?fields=comments
go through the below doc: https://developers.facebook.com/docs/instagram-api/overview
and make sure you have those permissions added to your access token before you run the endpoint.

Google People API unauthorized

I want to get my own Google Contacts so I read up on the People API documentation, on the "Authorize Request" section under the "Acquiring and using an API key" it says:
API keys: A request that does not provide an OAuth 2.0 token must send
an API key. The key identifies your project and provides API access,
quota, and reports.
The API supports several types of restrictions on API keys. If the API
key that you need doesn't already exist, then create an API key in the
Console by clicking Create credentials > API key. You can restrict the
key before using it in production by clicking Restrict key and
selecting one of the Restrictions.
So that seems easy enough, I went to the project page and created an unrestricted API Key, then I can create this request URL: https://people.googleapis.com/v1/people/me?key=API_KEY&personFields=names, with the API key just in the URL, as this statement suggest.
After you have an API key, your application can append the query parameter key=yourAPIKey to all request URLs.
But when I run the URL I posted before it returns this:
{
"error": {
"code": 401,
"message": "The request does not have valid authentication credentials.",
"status": "UNAUTHENTICATED"
}
}
What am I doing wrong? :(
Turns out the solution is pretty simple and I feel quite stupid, it isn't possible to access your own Google Contacts or any other private data using the API key, if you're trying to access any private data you should use OAuth 2.0 and not an API key (unlike for instance a public YouTube play-list where you CAN use an API key). Thanks to #Mateo Randwolf

What permissions are needed to call /{page-id}/ads_posts on Facebook Graph API?

I'm trying to list the Ads for a Facebook Page using the Graph API /{page-id}/ads_posts endpoint, but I get a permissions when I try to.
Using the Graph API Explorer, I generate an Page Access Token with those permissions: email, read_insights, manages_pages, pages_show_list, ads_read, business_management, instagram_basic, instagram_manage_insights and public_profile.
I'm an admin on the Page itself, the attached Business Manager and on the corresponding Ad Account.
Every time I try to call the /{page-id}/ads_posts, I receive
{
"error": {
"message": "(#200) Not enough permission to call this endpoint",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "XXXXX"
}
}
I can't find any help on the Facebook documentation or Google, given that the error isn't really meaningful (in some cases, I get a message saying that a specific permissions is missing, but not here). Anyone can help ?
EDIT: I tried to add the ads_management permission too, without success.
You need to add those pages to your app that is in development mode (https://www.facebook.com/settings?tab=business_tools).

scalr api with postman client an

I am working on scalr and trying to access scalr api using postman client but I have getting error:
{
"meta": {
"requestId": "63b814f1-f885-48cc-85d6-762e524e0bfb"
},
"errors": [
{
"code": "BadAuthentication",
"message": "Unsigned request"
}
]
}
For scalr api they have given Access keyid:xxxxxxx and secret key: xxxxxxxx so I am using basic auth for authentication process and giving:
username:(scale key id)
password:(scalr secret_key)
Scalr apis working fine with scalr api interface but throwing error with postman client.
Please suggest me what is the problem.
If you are using the API v1 (deprecated) that is currently available in Scalr Open Source, you need to get the signature from your user profile as described in the documentation.
If you are using Scalr Enterprise which supports the current API v2, authentication is described in the API Explorer.

Calling Ads API reachestimate returns "Application does not have permission for this action"

Following the Ads API docs for reachestimate (http://developers.facebook.com/docs/reference/ads-api/reachestimate/), I received a "false" response when calling
https://graph.facebook.com/act_0000000000000000/reachestimate?currency=EUR&targeting_spec={'countries':['US']}&access_token=___
(Note: act_0000000000000000 is my user Id and _ is my access token - these tokens work correctly for other Ads API calls).
Using the Graph API Explorer tool, I receive the following response on this API call
{
"error": {
"message": "(#10) Application does not have permission for this action",
"type": "OAuthException",
"code": 10
}
}
However, when I call
https://graph.facebook.com/1111111111111111/reachestimate?currency=EUR&targeting_spec={'countries':['US']}&access_token=___
where 1111111111111111 is an adgroup, I get a valid data structure.
Has anyone come across this elsewhere? Is there a "magic" setting somewhere that enables this capability on the user account (enabled for ads_management, offline_access)?
Any thoughts very welcome.
Thank you.
Thanks #Igy - just confirmed that my issue was indeed the misuse of my UserID in account field - have since migrated these queries to use the designated account ID and works as expected.