can an app post a message into yammer as itself - yammer

The docs seem to indicate that once a user authenticates via oauth to an app, the app can post messages on behalf of the user.
What I want to be able to do is post messages as the app. For example the app might search the web for some trending news and than post this trending news into a Yammer group called trending news. However, currently it seems that the app can only post to such as a group as an authenticated user say "john doe". Is there anyway instead that the app can post to this group as user "app-trending news"
Thanks

Messages have to be associated with a user. Therefore you have to create an "app-trending news" user. This is "by design" otherwise machine generated content would drown out user conversations. It's a fine balance but users react negatively to content posted from "bot" users like this, or don't engage with the content they post in.
If you have machine generated updates you can post to the Activity Stream and include a message there.

Related

Microsoft Teams Redirect URL to a Thread or Group Conversation

I've been using the next URL to redirect any user to their private chat with our MS Teams App:
https://teams.microsoft.com/l/chat/0/0?users=28:b9cc7986-dd56-4b57-ab7d-9c4e5288b775
with b9cc7986-dd56-4b57-ab7d-9c4e5288b775 being the App Id of out bot (sample App Id in this case).
This URL will open the private MS Teams Chat with the user clicking the URL and our App on any client (Mobile, Desktop, Browser) without opening any web pages if not needed. The clients can handle the URL themselves. You can try it with this provided sample URL.
What would be a proper way to be able to redirect to a group conversation or thread?
I've thought about using the Conversation Id (or other Ids available in our MS Teams App) or something but couldn't find any good documentation or examples online.
You can use Deep Links to accomplish that, specifically deep linking to a chat. As shown in that link, you can link to specific users, but also set a conversation topic as well as an initial message. One thing that's often overlooked, just fyi, is this sentence:
New chats are created in draft state until the user sends the first message

Google Meet integration api (like Hangouts app for Slack)

I want to utilise Google Meet api, which is used in Hangouts integration for Slack, description follows
TL;DR:
Links such as https://meet.google.com/new?gid=123&gd=qwe987 can be generated, so a modal is shown which can ask user's confirmation and then some request is sent from user's browser (where the Google Meet page is opened) to some endpoint (probably it is determined from gid which seems to be google application id). Is there a way to configure my application to have a webhook, so I can generate these custom links?
There's Google+ Hangouts app for Slack. Here's how it works (after you add the app in your workspace):
you send /hangout command in any Slack channel
slackbot sends an "Only visible to you" message in this channel with a link to start a new hangout. it looks smth like this (I changed data in the link): https://meet.google.com/new?gid=691521906844&gd=THTJ30X6W%7CU01113BD13M%7CD01113BDB5Z%7Csuren%7C%7C1846381238693%7C1%7CB01QFGG5GJF%7CE1MDm4DWcuVa0RbN5ZT9o5KF
when you visit the link, a new meeting is started instantly, and the page shows modal with text "To bring others into this video call, post a link it to your Slack channel" with buttons 'Cancel' and 'Post'.
when you click 'Post', a new message is sent to the Slack channel, where the command was sent. Text is "#Suren Khorenyan has started a Google+ Hangout and would like you to join. Join Hangout." and contains a link to the meet, which was created previously
How can I utilise this integration for another app, like Mattermost (or anything else like Telegram chats via bots)?
As I see, data in the url slightly changes. Probably it's payload for Google Meet to trigger Slack to send a message with link to the channel.
gid seems to be something like google app id
gd seems to be something like google data. If I url-decode it, it becomes THTJ30X6W|U01113BD13M|D01113BDB5Z|suren||1846381238693|1|B01QFGG5GJF|E1MDm4DWcuVa0RbN5ZT9o5KF. This is some kind of payload, separated by pipes (obviously), but I don't know what any part of this means (suren is my username in the Slack workspace, probably this is used for creating an invitation message).
When I click Post, this happens:
a new POST request to https://hooks.slack.com/services/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 is sent with form-data
hangout_id: 1812381238693
hangout_url: https://meet.google.com//abc-iuqx-def
a new message is posted to the Slack channel
Google meet somehow knows where to post back! Is this configured at the Google application (application id is provided via gid)? How can I configure my application for such behaviour? Where can I setup webhook url?
If we breakdown the request, we can see that url contains some parts of the gd payload:
THTJ27X6W - this is the first part of the gd payload
B01ABCD5GJF - last but one
E1MDm4DWcuVa0RbK5ZT9o5KD - the last part of the gd payload
and form-data contains:
hangout_id - this is in the gd payload after my name
hangout_url - obviously, this is the url for the new created meeting
How can I change it for my needs?
I created a new application at Google APIs dashboard (here console.developers.google.com/apis), but can't find any docs for this integration. There's Google+ Hangouts API in API Library, but it says Apps will continue to function until April 25, 2017..
I tried to approach it from another side:
In the API Library there's Google Calendar. I found mattermost-hangout app on GitHub (had to update it a bit, so it works with updated api). Here's how it works:
oauth2 for authorising at google (single account)
it handles POST request, which is meant to be received from Mattermost (triggered by a slash command),
creates a new calendar event using Google Calendar API (with conference),
takes hangouts url from the response and sends a new message in the Mattermost channel with invitation to join the meeting.
But it has some downsides:
you have to use one account to authorise all event creation events (yeah, it can be upgraded to authorise any number of users, but it'll be inconvenient. why to force anyone to provide access to their Google Account, when Google Meet authorisation just happens in browser, we don't need to create events)
account, used for auth, now has events in his calendar. of course, events can be deleted, but it's not the way.
Is there any documentation on utilising gid and gd params?
Generally, I want to find a way to configure a webhook in my app, so when Google Meet finds my application's ID in the gid query param, it looks at the app's config and sends a request to my app (previously configured endpoint (I assume it works this way)).
Of course there's a chance that it's some kind of internal API and it cannot be used by everyone, but I could not find any information on this.

Slack integration: link slack user and user from 3rd party Web service

I have some Web Service (for example, Twitter). This service already has users, so every user has account.
I want to provide ability for user to enter something like that in slack:
/tweet "Amazing tweet sent from Slack"
And this tweet should appear at Twitter's page of this user(say, John D. with id=1).
I read something about Slack apps, so highlevel overview is the following:
I need to create a new Slack app
I need to register slash command in this app and provide backend URL which will handle all requests from slack users (like https://twitter.com/slack-integration)
When user enters /tweet "Some tweet", then the following will be sent to https://twitter.com/slack-integration:
user_id=U2147483697&user_name=SlackUser&command=/tweet&text=Some tweet
So, user_id is Slack user id. And now I need a way to link it to John D. with id=1.
Any ideas, what should I do for that?

How to implement a chat application in codeigniter website?

I need to implement a chat window on my codeigniter website,and the chat option is not like facebook or gmail chat.The Live conversation is entirely between the admin and the user who has logged into the site,ie live chat for direct customer service
Thanks in advance.
A quick search on github gives me this:
https://github.com/Runnable/Chat-Example-App-for-Codeigniter-API-on-PHP
https://github.com/vgoodvin/ci-chat
https://github.com/llbbl/codeigniter-chat
You can think of it like a thread in a forum where someone creating a thread and the other someone make replies.
Depending on how you want to customize your apps, the interaction between the OP and those who will make replies will be rapid.
EDIT 1:
Assuming that you understand how MVC works, you can have something like this:
Your DB Structure:
Table User
Table Session
Table Message
A user can be in many Session (chat room), A message can only be posted to one chat session and a user can send many messages.
In your chat page you will have a to display the conversation, a giant text box where your user can write their message and a submit button.
When a user click the submit button, it will then make an HTTP POST to your controller, where your controller will cleanse the data (i.e. $this->form_validation->set_rules();
If the posted data is valid, send it to your model where it then be stored to your database.
Everytime the chat page is loaded what you want to do is:
Get the chat message for the associated session ID.
Again this is an oversimplified example. You can fork the code from the github i mentioned and try to install it on your local machine.
If you want messaging or chat and specially for codeigniter than use this library, Mahana-Messaging-library-for-CodeIgniter. I have used this, and i preferred you if you are learner. It have it's on database which you can manage and it will integrate in your project easily.
Implemented using Zopim chat widget,which is suitable for both CMS and MVC websites. https://www.zopim.com/

Is it possible to post on an event feed on behalf of the user?

Here's the scenario:
The user has set that is attending an event, I want through my app (php sdk) to post on that event's feed on behalf of the particular user. I already have publish_stream extended permission from the user.
The post might happen at a later stage while the user is offline (but from what I understand offline permission is now depreacated).
Yes, you can post link, post or status message to Event feed via Graph API, you should issue POST request to feed connection of event
This is an example for publishing link:
POST https://graph.facebook.com/EVENT_ID/feed?link=http://example.com&access_token=...
As you noticed offline_access permission is deprecated (and will stop working May 1, 2012, see Developer Roadmap) you should read how to handle expired access tokens and how to extend token.

Resources