How can I show information such as number of users, group logo using telegram api on the website? - api

I will open a telegram group and channels section with a new post type on my wordpress site. Then I will list them in a page using array. During this listing, I want to automatically show information next to each telegram group. This information will be information such as the number of telegram users, logo. How can I use a code to pull this information on telegram using api.

Related

How do i get user images on twitter using Twitter API?

I'm trying to download users timeline images (including tweets images). How do i get user images on twitter using Twitter API.
[https://api.twitter.com/labs/2/tweets/1138505981460193280?expansions=attachments.media_keys&tweet.fields=created_at%2Cauthor_id%2Clang%2Csource%2Cpublic_metrics%2Ccontext_annotations%2Centities][1]
This API proved all the details about a single tweet. If any possible solution to get all images from a standard twitter app. Or this feature only available in premium account ?
You can do this using the v2 User timeline endpoint:
twurl "/2/users/786491/tweets?max_results=100&expansions=attachments.media_keys&media.fields=url,media_key"
You can retrieve up to 3200 of the user's most recent Tweets using this method. You can get additional information by adding further fields and expansions to the request, if you need them.

URI/Hyperlink to Bot created using Google Chat API

We would like to add a hyperlink in our intranet which when clicked will open google chat conversation with the specified bot developed using Google Chat API.
When creating a chatbot via https://console.developers.google.com/apis/api/chat.googleapis.com/hangouts-chat?project=xxxxxxxx, the only identifying information about the bot appears to be an App ID (Project Number) and the Bot name.
As of 2020 version of Google Chat, there appears to be no documentation on how to create a direct URI to a user or bot ID) say something like https://chat.google.com/users/XXXXXXXXX where XXXXXXXX is the Bot ID
An inspection of the Google Chat Web Widget (https://chat.google.com) roster/contact list when communicating with the bot suggests that bot identifiers are of the form user/bot/114553095703997684XXX or user/114553095703997684XXX where 114553095703997684XXX is the App Id referenced earlier.
How can we programmatically construct a direct URI to the chat bot given its App ID or Name?
There is currently no method to create a URL that opens a space with a user or bot.
To get a list of spaces you would need to already be part of one.
I would suggest creating a Feature Request if you have not yet. Create an Issue and submit it as a Feature Request.

Getting the last post from a Google+ company Page using REST API

I am developing a website for a hotel company. The client wants the home page of the new website to show the last post made on its Google+ Page. Unfortunately, I cannot rely on the "embedded post" feature, because the layout will have to be fully custom. Neither my company nor my client is a Google Partner or owns a Google Apps for Businsess account. Reading through the documentation, it seems that Pages API are accessible only by partners.
Two questions:
Do I actually need to use Pages API in order to access the company page stream?
Do we actually have to become Google Partners just to perform such a simple integration task?
I was about to walk along a long, winding and useless road. The post stream of a page can be retrieved with the Activities.list method, and the last post can be selected by specifying a proper value for the maxResults parameter
https://developers.google.com/+/web/api/rest/latest/activities/list
By using the "API explorer", we can see that the userId field can actually be filled with a "page id". For example, if we want to obtain the stream of the following page:
https://plus.google.com/102884112172662547291
we shall pass 102884112172662547291 as userId.

Instagram api - get all photos by hashtag

I am new to this Instagram API, and I read their doc about endpoints, this is the endpoint that I am using:
/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
It is fetching the images, but, only on my accounts photos. I want is, I will give an tag-name, and it wll display all, not just the photos on my account, but all the photos in Instagram too.
I know has been a long time, but just for the record.
Since you need the public_scope permission for this (the permission that gives you access to all public data on instagram, and not only your account) you need your app to be reviewed and approved by Instagram. However, if you're using the API for a one-site personal project, Instagram will not approve it.
Here's from Instagram's docs:
1: Which use case best describes your Instagram integration?
R: I want to display hashtag content and public content on my website.
A: This use case is not supported. We do not approve the
public_content permission for one-off projects such as displaying
hashtag based content on your website. As alternative solution, you
can show your own Instagram content, or find a company that offers
this type of service (content discover, moderation, and display).
You can find more information in the Permission Review documentation.
Your client is in Sandbox Mode and can only search for tags of photos posted by invited users. You have to login into https://www.instagram.com/developer, edit your client and click on the "GO LIVE" button.
If the "GO LIVE" button is disabled, you have get your app reviewed by Instagram first: Click on the Permissions tab and submit for review. (Company Name, Contact Email and Privacy Policy URL are required to start a submission.) Once approved, u will be able to click Go Live.
By hashtag you mean tags.
It works for me. Despite I'm using python client, it should work well when you're developing your own client. Look:
from instagram.client import InstagramAPI
api =InstagramAPI(client_secret=settings.CLIENT_SECRET,
access_token=settings.ACCESS_TOKEN)
result = api.tag_recent_media(tag_name='castle')
media = result[0]
for m in media:
print (m.images)
print (m.user)
print (m.tags)
You can try it and it is working for me.
/v1/tags/{tag-name}/media/recent?client_id={YOUR_CLIENT_ID}
My client id is created before "permission review", it is working now and I am trying to submit permission review to Instagram now, hope it will pass.

Instagram API - Is it possible to search for a users hashtag posts

Is it possible to search all posts with a specific hashtag by a certain user?
I am new to development and I am trying out Instagram's API if I can search such combination.
It is possible, but not using only a single request to Instagram's API. There are two solutions:
Search for posts by given hashtag's name using GET /tags/{tag-name}/media/recent request and then manually check every post if its user is the user you want.
Search for posts by specific user using GET /users/{user-id}/media/recent request and then manually check every post if its tags array contains the specific hashtag you want.
I would recommend to choose the solution in which you can expect less results (posts) to filter. In most cases it means the second one, because there is more posts on Instagram with a specific hashtag than an average user share on its Instagram's accout.
You can test Instagram's API requests with Instagram's API Console: http://instagram.com/developer/api-console/