error: 400 when using google natural api to analyze entities - php

I'm using Google Natural API to analyze entities in text which I pull from DB. Everything was working fine, but suddenly it is showing me this error.
{ "error": { "code": 400, "message": "The language ur is not supported for entity analysis.", "status": "INVALID_ARGUMENT" } }
The text is simple English. May contains some links in it but nothing special. Please help me how to fix this issue.
Thanks.

Related

WooCommerce API Get User Information

so I've been trying to get the WooCommerce REST API to give me single users and all users information to no avail, I keep getting the error:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 403
}
}
Using Basic Auth with an https address, the API has both read/write permissions as well.
Using the format of:
https://exampledomain.com/wp-json/wc/v3/customers/
It might be that your server doesn't parse the Authorization header correctly. Try to to send the credentials as query string parameters like this:
https://www.example.com/wp-json/wc/v3/customers?consumer_key=123&consumer_secret=abc
Reset admin and it worked like a charm, weird as hell but yep.

One of the provided arguments is not acceptable creating folder using Microsoft Graph API

I am using Microsoft Graph Library for PHP (microsoftgraph/msgraph-sdk-php) to save documents in Onedrive for Business.
I am having issues to create items (folders or upload files) using Microsoft Graph API, for instance, when I am creating folders I am getting:
"Client error: `POST https://graph.microsoft.com/v1.0/drives/MYDRIVEID/items/MYPARENTFOLDERID/children` resulted in a `400 Bad Request` response: { "error": { "code": "invalidRequest", "message": "One of the provided arguments is not acceptable.", "innerError": { "request-id": "bec1d260-3efd-4417-ba80-96ec37078df6", "date": "2018-07-20T16:48:34" } } } "
POST
https://graph.microsoft.com/v1.0/drives/MYDRIVEID/items/MYPARENTFOLDERID/children
body:
{"name":"Project1","folder":{}}
This is the code I am executing:
$graph->createRequest("POST","/drives/$driveId/items/$itemId/children")-
>attachBody($body)->setReturnType(Model\DriveItem::class)->execute();
My guess is that the API is expecting something different than I am sending, I have tried to change the body, for instance:
{"name":"Project1","folder":{"childCount":0}}
{"name":"Project1","folder":{},"#microsoft.graph.conflictBehavior":"rename"}
{"name":"Project1","folder":{"childCount":0},"#microsoft.graph.conflictBehavior":"rename"}
but I am still getting the same error.
I am not sure what I am doing wrong
Any ideas?
Thanks in advance for your help
I deleted the app registration and registered it again in azure portal. Create folder operation is working as expected.

APINotAllowedError while getting recent photos from instagram

I am getting the following error while using the media/recent API.
{
"meta": {
"error_type": "APINotAllowedError",
"code": 400,
"error_message": "This tag cannot be viewed"
}
}
I have tried with client Id and access token.
https://api.instagram.com/v1/tags/mytag/media/recent?client_id=clientId
or
https://api.instagram.com/v1/tags/mytag?access_token=accesstokem
Also, I created new App in different Instagram account and tried. It gives me the same error.
Only for particular hashtag I am getting this error, for other hashtags I am getting the proper response.
Please help me.

How can I automatically scrape new information from page with Facebook open graph API

Hi I have this problem with Facebook open graph API.
I know I can manually scrape new information about meta tags from a page with https://developers.facebook.com/tools/debug/. But I'm trying to use api to do it automatically, but I just can't understand what is going on.
I stumbled across this https://developers.facebook.com/tools/explorer/145634995501895/. Can you guys tell me exactly what to type there to scrape new og meta tags?
For page: http://www.akademiaharmonia.pl/o-jodze.html
What I tried: in this Graph API Explorer I chose "POST" and added 2 fields:
id = http://www.akademiaharmonia.pl/o-jodze.html
scrape = true
I got this error:
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104
}
}
I don't really understand why but it works perfectly fine now. I also noticed that the graph explorer is now 2.1 instead of 2.0... hmm...

PHP Google Play Subscription API

I am trying to get Google Play API subscription details using PHP and using following url to get purchase data :
https://www.googleapis.com/androidpublisher/v1/applications/[PACKAGE]/subscriptions/[SKU]/purchases/[PURCHASE_TOKEN]?access_token=[ACCESS_TOKEN]
I am getting the following error:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "developerDoesNotOwnApplication",
"message": "This developer account does not own the application."
}
],
"code": 401,
"message": "This developer account does not own the application."
}
}
Please help me sort out.
Just providing the URL does not help you get data of any application. How can you think so.? Isnt it insecure.? You have to get proper data by which you can at least prove ownership for the app..

Categories