Facebook/Instagram location id - instagram-api

Hi i need to create aplication for android as my course work project for university.
But in order to finish it i need to get INSTAGRAM location id using longitude and latitude.
For instance i have Latitude and Longitude 40.752340, -73.979873 and i need to convert tham to Instagram location id.
I was just wondering is the are any ways i can get location id ?
i was using this method but it doesnt work anymore
https://api.instagram.com/v1/locations/search/?lat=40.758895&lng=-73.985131&access_token=ACCESS TOKEN
but every time i try to use it i see
{"meta": {"code": 400, "error_type": "APINotAllowedError", "error_message": "This endpoint has been retired"}}
is there any way i can get location id?

Related

Instagram API - get like count on media

Good morning,
I'm writing my own library to improve skills for getting media from Instagram profile and showing it on my website.
I read a lot of articles, documentation, etc. but there are many old versions and endpoints. At the official API documentation, I'm unable to find, how to get like count or comment count on every single media.
So:
I can OAuth - OK
Get short-live token - OK
Get long-live token - OK
Refresh long-live token - OK
Get media list - OK
Get one media based on its ID - OK
But none of endpoints gives me like count or comment count. How can I achieve this?
https://graph.instagram.com/me/media?fields=id,caption,comments_count,like_count,media_type,media_url,thumbnail_url&access_token=
returns me:
{ data: [{ "id":"123456798", "caption":"My title", "media_type":"IMAGE", "media_url":"https://..." }, { ... }] }
I found in the documentation https://developers.facebook.com/docs/instagram-api/reference/ig-media/ that I can get the like_count field only for requests at media with their ID. So I tried EP:
https://graph.instagram.com/v15.0/123456789?fields=id,caption,media_type,media_url,thumbnail_url,like_count&access_token=
and return is: Tried accessing nonexisting field (like_count) on node type (Media).
On the instagram I've able to get likes and comments and the media has likes and comments. What I'm doing bad? Thank you for your time.

Instagram Hashtag Search API returns error message "user_id is required" although I have provided it

I am trying to get data about media from my IG Business account with a specific hashtag.
I used Graph API Explorer and tried with
/{hashtag_id}?user_id={instagram_business_id}&fields=recent_media
but I got an error "(#100) The parameter user_id is required."
Does anybody know what may be the problem and how to solve it?
The API URL is incorrect, your URL should look like this:
/{hashtag_id}/recent_media?user_id={instagram_business_id}&fields=id,caption,media_url...

How can send the telegram bot location to users?

I want to send location of the bot to users, I very searched about it in google , but i find just this case"send location of users to the bot" I want versa case that mean:"send location of the bot to the users".
this is my idea: the owner of the bot is a driver who that want to share his location with the users of the bot,in the bot i put a button,when the users click on that button, the bot tell them location of driver.the location of bot is variable and it isn't constant
Sample request for send location from Bot to user with URL:
https://api.telegram.org/bot[botToken]/sendlocation?chat_id=[UserID]&latitude=51.6680&longitude=32.6546
Requirement for execute URL:
[botToken], e.g:399684XXX:AAH_NiVFtLXVmh4XXX-XXXEZo3yO6XXX
[UserID], e.g:64326XX
latitude , e.g:51.6680
longitude, e.g:32.6546
You can use sendVenue or sendLocation method to do it.
use sendLocation and not a web request to telegram api, to get the longitude and latitude you can use messageEventArgs.Message.Location.Latitude and messageEventArgs.Message.Location.Longitude with telegram c# bot api

Instagram get latest images of a location

Assuming I have the facebook location ID. Let's take the Eiffel Tower for example.. 223779540985538. I got the instagram location ID from this facebook location ID, which is 292188415.
I used the following endpoint to get the instagram location images:
https://api.instagram.com/v1/locations/292188415/media/recent?access_token=***
but since the last instagram update all queries return this:
{"pagination": {}, "meta": {"code": 200}, "data": []}
What's wrong? What I am missing?
if you want search media by its location, you must have lat and long data. you can see example here : https://www.instagram.com/developer/endpoints/media/

Office 365 unified API error "Resource not found for the segment 'UserPhotos'."

A week or two ago, if a user had no photo the Office 365 unified API would return metadata for a photo of size 1X1. Now it's returning the error:
{
"error": {
"code": "RequestBrokerOld-ParseUri",
"message": "Resource not found for the segment 'UserPhotos'."
}
}
Now the error has started to appear for users that do have photos. It's been getting progressively worse over the last few days, to the point that the API is unusable now. It started off as only a few missing photos, and now only 1 user photo is returned successfully out of over 250 users.
All User Photo endpoints are returning this error. E.g:
https://graph.microsoft.com/beta/me/userphotos
https://graph.microsoft.com/beta/xyz.onmicrosoft.com/users/someUserId/userphotos/48X48
https://graph.microsoft.com/beta/xyz.onmicrosoft.com/users/someUserId/userphoto/$value
The error is occuring in the sandbox too (although I can't be sure the user in the sandbox does have a photo to begin with).
Is there any known workaround or fix for this issue?
There have been some updates in the API:
http://dev.office.com/blogs/Update-3-on-Office-365-unified-API
to get to the photo, please use /photo instead of /userPhoto
From this question:
The endpoint is now called "photo" and not "userphoto"
To get the photo information you use:
api/beta/Me/photo
To get the photo you call
api/beta/Me/photo/$value
I haven't been able to get photos for a given size (eg beta/Me/photo/48x48) to work

Resources