Error code 010010 is reported when the textSearch API is used after the HMS Core Site Kit is integrated - huawei-mobile-services

I've encountered some problems when using Postman to verify nearbySearch of HUAWEI Site Kit. Can anyone help me?
The function of nearbySearch is to search for nearby POIs meeting the requirements. The following are my requests.
The Post method is used and the header is: https://siteapi.cloud.huawei.com/mapApi/v1/siteService/nearbySearch?key=CV7BC1sVBsLAUHByHhfS9DYd8E5K%2FFlQZ4al3ANV4wKa%2BdQgtDPDlcFcCvilr2K1sbYID1A3Db%2F%2B%2FCK5mcR1%2BWUNIjvF
The body is:
{ "location": { "lat":12.9219, "lng": 77.6193 }, "radius": "5000", "poiType": "bank", "countryCode": "in", "language": "en", "pageIndex": 1, "pageSize": 1, "politicalView":"in" }
I find a bank near the longitude and latitude on the map. However, the request cannot find the bank successfully.
Post request result:
{ "returnCode": "010010", "totalCount": 0, "returnDesc": "INVALID_REQUEST" }
Error code 010010 indicates incorrect parameter. However, I do not know what is incorrect.
Can anyone help me?

According to Huawei LocationType, you should enter BANK instead of bank. Enter BANK to try again.

Related

Facebook Graph IP filtering

I've read few posts around about the limitations on 600 requests in 600 seconds that Facebook Graph Api sets on requests.
This question is about getting some clarification in the issue I'm facing.
I'm doing requests, quite simple to the FB Graph:
So, from my home I run:
curl https://graph.facebook.com/v2.0/?id=https://www.example.com/article/the-name-of-the-article/
(Having the trail slash is not trivial)
which gives me empty results:
{
"share": {
"comment_count": 0,
"share_count": 605
},
"og_object": {
"id": "XXXXX6ZZ70301002",
"description": "text",
"title": "title",
"type": "article",
"updated_time": "2019-03-09T00:15:06+0000"
},
"id": "https://www.example.com/article/the-name-of-the-article"
}
I took the url from js code in the website.
Instead, running the Scrapy crawler, on the same url, still from home network, gives me the same as above:
{
"share": {
"comment_count": 0,
"share_count": 605
},
"og_object": {
"id": "XXXXX6ZZ70301002",
"description": "text",
"title": "title",
"type": "article",
"updated_time": "2019-03-09T00:15:06+0000"
},
"id": "https://www.example.com/article/the-name-of-the-article"
}
Which is more than fine for now and the js-code-scraping system seems to be working. The results contain all the information from js calls to FB Graph.
Hands on server side, the crawler runs as expected, but having a closer look at the results, information coming from js code execution is not there.
I've checked the whole code, in other url which also fires js actions to provide html content and the code actually works fine.
Then, repeating the simple:
curl https://graph.facebook.com/v2.0/?id=https://www.example.com/article/the-name-of-the-article
this time from the server ip, it replies:
{
"error": {
"message": "(#4) Application request limit reached",
"type": "OAuthException",
"is_transient": true,
"code": 4,
"fbtrace_id": "ErXXXXZZrOn"
}
}
Regarding ip-blocks, the code wasn't able of delivering more than 600 requests. Actually it sent less than 10 requests to the graph api.
Obviously, the information coming from js requests to the Fb Graph Api from server side is missing.
I tried from different servers, from different providers, to check if there was a Ip filter on Cloud providers, but it seems that is not the case, as in every server the results are the same.
What is going on here?
Why the js requests do not get valid response data when they are fired from server ip addresses? (as it gives the error OAuthException:Application request limit reached also using the curl command)
Thanks for any clue

Facebook insights api Positive Negative Feedback

I am trying to find the fields that represent the Facebook Positive/Negative feedback for Ads within the Insights API. Searching here and cant find it
https://developers.facebook.com/docs/marketing-api/insights/fields/v2.8
Does anyone have any suggestions?
You can obtain that data from the relevance_score field. It'll give a response like this:
"relevance_score": {
"score": "8",
"positive_feedback": "HIGH",
"negative_feedback": "LOW",
"status": "OK"
}

Facebook API not working sometime for some URL

I'm getting number of shares and comment of blog posts using facebook graph api for my blog, but sometimes it do not return shares and comment.
Following URL is not giving number of share and comments.
http://graph.facebook.com/?id=http://www.lehedonist.com/jeans-is-the-new-whiskey-2001
BUT it is working for this URL:
Example: http://graph.facebook.com/?id=http://www.lehedonist.com/spring-slam-fashion-war-ss16-1965
I somehow wonder why it's even working to request these URLs without an access token to be honest.
See
https://developers.facebook.com/docs/graph-api/reference/v2.5/url
It only gives a result if there no version info in the URL. To do this in the v2.5 way properly, you'd have to use
https://graph.facebook.com/v2.5/?access_token={access_token}&fields=id,og_object,share&id=http://www.lehedonist.com/spring-slam-fashion-war-ss16-1965
where {access_token} is an actual access token.
Results will look like
{
"id": "http://www.lehedonist.com/spring-slam-fashion-war-ss16-1965",
"og_object": {
"id": "987675524635070",
"description": "Not your usual fashion post, we decode styles best suited to your personality and what should you be sporting next summer",
"title": "Spring Summer 16 fashion: The clash of fashion personalities",
"type": "article",
"updated_time": "2015-10-08T11:24:32+0000",
"url": "http://www.lehedonist.com/spring-slam-fashion-war-ss16-1965"
},
"share": {
"comment_count": 2,
"share_count": 81
}
}

facebook graph api fields not returning

We've recently noticed responses changing a call to calls like:
/me?fields=adaccounts.fields(age,capabilities,currency)
Previously, we would get a response with the requested fields filled in, but now they are coming back with a response similar to:
{
"id": "XXXXXXXXXX",
"adaccounts": {
"data": [
{
"account_id": "XXXXXXXXXXXX",
"id": "XXXXXXXXXXX"
},
{
"account_id": "XXXXXXXXXXX",
"id": "XXXXXXXXXXXXX"
}
],
"paging": {
"cursors": {
"after": "NjAwMjIwMTIyNzM4OA==",
"before": "NjAwMjk2ODQ2OTc1OQ=="
}
}
}
}
Has something changes there? We've been making calls via the api directly and on the Graph API Explorer tool.
Thanks for any help!
UPDATE:
Getting the details for adaccounts fields now requires hitting another endpoint:
/me/adaccounts?fields=age,capabilities,currency
There's no need for multiple calls, you can simply do:
/me/adaccounts?fields=age,capabilities,currency
On October 2nd Facebook made changes to the ads API that requires you to specify what fields you want returned from all the end points. This includes ad account, campaign, group and creative. You must now issue the query with fields=fieldname,fieldname,fieldname with all the fields you want returned when performing a get request. Officially these changes were forced on for applications Friday Oct 4th.
A link with details about the Oct 2nd breaking changes can be found here: http://developers.facebook.com/roadmap/
Hope that helps!
Thanks,
Erick

How to get total number of tracks in a playlist using soundcloud json API

I am trying to paginate the track list of a set/playlist obtained via soundcloud JSON API. Pagination technique described here works fine if I want to generate tracklist of x number of tracks for next page only. What I am trying to do is to make a numbered pagination with multiple page links. I didn't find any parameter such as "track_count" which returns the total number of tracks for "/user/tracks". So, can anyone give me any insights on making a numbered pagination for a playlist when getting data via soundcloud JSON API? thanks
/users endpoint has "track_count" property in the returned representation of user:
$ curl "http://api.soundcloud.com/users/3207.json?client_id=YOUR_CLIENT_ID"
{
"id": 3207,
"permalink": "jwagener",
"username": "Johannes Wagener",
"uri": "http://api.soundcloud.com/users/3207",
"permalink_url": "http://soundcloud.com/jwagener",
"avatar_url": "http://i1.sndcdn.com/avatars-000001552142-pbw8yd-large.jpg?142a848",
"country": "Germany",
"full_name": "Johannes Wagener",
"city": "Berlin",
"description": "<b>Hacker at SoundCloud</b>\r\n\r\nSome of my recent Hacks:\r\n\r\nsoundiverse.com \r\nbrowse recordings with the FiRe app by artwork\r\n\r\ntopbillin.com \r\nfind people to follow on SoundCloud\r\n\r\nchatter.fm \r\nget your account hooked up with a voicebox\r\n\r\nrecbutton.com \r\nrecord straight to your soundcloud account",
"discogs_name": null,
"myspace_name": null,
"website": "http://johannes.wagener.cc",
"website_title": "johannes.wagener.cc",
"online": true,
"track_count": 12,
"playlist_count": 1,
"followers_count": 417,
"followings_count": 174,
"public_favorites_count": 26
}
This question is already old, but I hope this could help other people.
You could use either of this endpoint:
http://api.soundcloud.com/playlists/{playlist_id}?client_id={client_id}
https://api.soundcloud.com/playlists/{playlist_id}?oauth_token={oauth_token}
The 2nd API is undocumented, the first endpoint suddenly started to return 401 for no reason which is from the SoundCloud API documentation. I still provided the 1st endpoint as it's only not working at work, but behaves correctly at home IP address. I suggest if you'd use the 2nd API to generate and use a non-expiring token.
SoundCloud is not a reliable provider anymore as there's no app support for developers. You just have to figure things out by yourself.
On the JSON response, look for track_count. That'll give you the number of tracks in a playlist.