Implement PeerToPeer Calls using ms graph API - reactjs

I am able to create a call through my react application using graph API to a MS-Teams user in organization which is working fine call is being made to the graph API and it's dialing to the user in the organization but I don't think user can interact without any device setup i.e laptop speakers and all in order to listen and speak over the call.
API USED :
To make a call
https://graph.microsoft.com/beta/communications/calls
To get call summary
https://graph.microsoft.com/beta/communications/callRecords/{id}
I want to know how :
Do I need to create interface in my ReactJs App just in order to provide user all the facilities of calling? Right now I have only provided the Call button.
How can I handle the callback in the development phase and test things in my react app as callback are only sent to the https routes.
Note : I am using NestJs as backend.
Can anyone please provide a demo for this how to handle things properly as its now like a brain twister working with MS Graph APIs. I shall be highly obliged for the same as I am trying this thing first time.
Thanks in Advance.

To Create call You will need to register the calling bot. Which enables your bot to create a new outgoing peer-to-peer or group call, or join an existing meeting. Please go throgh this documentation and samples for more info.

Related

How to build real time streaming application

I am going to build application that shows real time data with React.
And I decided to use Pusher for real time data management.
I also trying to use open third party apis for getting data.
For example openweathermap for weather data.
My trouble is how can I know if the data from third party api is changed and let the Pusher know data is changed.
In one word, how can I make Pusher to connect third party apis?
Really want your help.
Thank you.
Maybe there is a system for it in Pusher but I don't know.
If it is possible for you, you can create a cron service that checks your 3rd API continually. But it has to be on a live service to run continually. If it detects any changes in the data, it can emit your client app by using Pusher, Socketio, etc.
Maybe the 3rd API provides this feature to you.

How to subscribe to Salesforce connected app webhooks?

I want to implement a connected OAuth app in Salesforce which should trigger push events in case some entities changed, for example an opportunity was closed.
Zapier implemented something similar
https://zapier.com/apps/salesforce/integrations/webhook
Could not find something I need which is a simple way to subscribe to entity changes using the OAuth client's token and passing a webhook endpoint. I read about apex callouts, streaming API and outbound messages.
Yeah, we solved this exact problem at Fusebit and I can help you understand the process as well.
Typically speaking here's what you need to do:
Create triggers on the Salesforce Objects you want to get updates for
Upload Apex class that will send an outgoing message to a pre-determined URL
Enable Remote Site Setting for the Domain you want to send the message to
Add in Secret Verification (or other auth method) to prevent spamming of your external URL
If you're leveraging javascript, then you can use the jsforce sdk & salesforce tooling API to push the code into the salesforce instance AFTER the Auth flow has occurred AND on Salesforce Instances that have API access enabled (typically - this is enterprise and above OR professional with API enabled).
This will be helpful for you to look through: https://jamesward.com/2014/06/30/create-webhooks-on-salesforce-com/
FYI - Zapier's webhooks implementation is actually polling every 15 minutes, instead of real-time incoming events.
In which programming language?
For consuming outbound messages you just need to be able to accept an XML message and send back "Ack" message to acknowledge receiving, otherwise SF will keep trying to resend it for 24h.
For consuming platform events / streaming API / Change Data Capture (CDC) you'll need to raise the event in SF (Platform Event you could raise from code, flow, process builder, CDC would happen automatically, you just tell it which objects it should track).
And then in client app you'd need to login to SF (SOAP or REST API), subscribe to channel (any library that supports cometd should be fine). Have you seen "EMP Connector", mentioned for example in https://trailhead.salesforce.com/en/content/learn/modules/change-data-capture/subscribe-to-events?trail_id=architect-solutions-with-the-right-api ?
Picking right messaging way is an art, there's free course that can help: https://trailhead.salesforce.com/en/content/learn/trails/architect-solutions-with-the-right-api
And pretty awesome PDF if you want to study for certification: https://resources.docs.salesforce.com/sfdc/pdf/integration_patterns_and_practices.pdf

Not able to create events using Microsoft Graph SDK

I am trying to create an Event using Microsoft Graph SDK, as following the document #
https://learn.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-beta&tabs=csharp
1.Created "authProvider"
2.Created GraphClient with above AuthProvider
3.Creating Event using
The event is not creating also no exception/error is throwing, Could any one help me here?
This is happening because this call is being made with same transactionId frequently. It avoids unnecessary retries on the server.
It is an optional parameter , just comment out this property and try again. It should work.
Note : This identifier specified by a client app for the server , to avoid redundant POST operations in case of client retries to create the same event and also useful when low network connectivity causes the client to time out before receiving a response from the server for the client's prior create-event request.
More info is required here, as the reply from Allen Wu stated. without any details I would focus my efforts on the authprovider piece and azure app registration piece. as the rest of the example is just sending a post request to graph api.
but what is recommended really depends on what type of application you are trying to build. eg. is it a service daemon, a web app, mobile app, desktop app, single page app, etc.

API Management - Single API for multiple Logic Apps

I have 5+ separate logic Apps that are called via HTTP Receive. Examples are:
GetUsers
GetLocations
GetCalls
etc.
I would like to expose the Logic Apps via API Management as individual operations on one API. Any samples online to show I can do that? Am I right to assume that I'll need a policy (url-rewrite, control flow)?
Any guidance appreciated.
You can add Logic Apps as operations on an existing API by:
Creating a new operation (by default http post for a Logic App)
Defining the request/response that your Logic App will expect you to pass to it
Go to the 'backend' element in the designer and select the 'forms based editor' from the designer.
In the editor, select 'Azure resource' and then browse to the Logic App you wish to use - the is should be an http request/response based Logic App.
Add other Operations and connect them up for each Logic App you want to use.

Is it possible to set up an IPN listener using client side scripting?

I'm integrating a web payment using angularjs.
My main goal are
to let the user be able to topup or pay via paypal
upon successful redirect him back to my site
If the transaction is successful i will then update our db records.
Glad to say that after 2days I'm done with the first 2 steps. Then I've read about using PDT (Payment Data Transfer) and I used this to get the transaction details of the payer but I had read many post saying using PDT isn't reliable enough that I also must use IPN (Instant Payment Notification). So I google about it and almost all sample/tutorial about IPN are made from using server side scripting. So is it possible to perform an IPN listener using javascript alone?
No, not on the client-side. You can use server-side Javascript (nodejs) to do this. The purpose of IPN is to let your server know that a payment is completed. The IPN request comes directly from paypal behind the scenes to a URL you give it. There's no way for a client to receive this signal instead, and if it could then there'd be a big security flaw because anyone could forge it.
However, you could update your backend using IPN, then use something like socket.io (websockets) or long-polling (plain old ajax) to let your client know that payment was successful. With long-polling, you'd basically be asking your back-end every second or two whether or not payment was succesful. With sockets, you have a more direct communication. I like socket.io because it falls back to long polling (or flash) if real web sockets aren't available.

Resources