Blocking contact with RingCentral API - ringcentral

What is the API we can use to block a contact in RingCentral from calling me?
I have tried successfully to block a contact number in the desktop application and I was successful in it but, out of the API's available, I am not getting any API that can block number from my phone.

You can use Call-Blocking APIs of RingCentral to block a contact number, update the blocking, allowing a contact, delete a blocked number.
Here is the Call-Blocking APIs:
https://developers.ringcentral.com/api-reference/Call-Blocking

Related

Is it possible to send and fetch Facebook messages using Graph API for v4.0 or greater?

I want to create a web application using PHP which will allow to connect Facebook accounts with my application and once they authenticated my application can fetch inbox messages of that user and can auto reply to the messages received against authenticated Facebook accounts.
Also, allow user to send messages manually from my application to Facebook inbox.
Is this possible with Graph API or any other Facebook API which will allow me to do above mentioned things.
Some people was told that this feature is no longer available after Facebook Graph API v2.4.
and once they authenticated my application can fetch inbox messages of that user and can auto reply to the messages received against authenticated Facebook accounts.
Neither of those two things is possible.
You can not read the messages of user accounts any more, and you can not reply in their name either.
The only messaging that can be handled via API, is that between a user and a page.
Assuming you refer to Page conversations, not user conversation, see /conversations and /messages docs here:
https://developers.facebook.com/docs/graph-api/reference/page/conversations/
https://developers.facebook.com/docs/graph-api/reference/v5.0/conversation/messages

Does Outlook.com provides any webhook/push-notification support?

I'm planning to write a web service to automate some task for my Outlook.com email account. I want Outlook.com to send an HTTP request to my endpoint when an email arrives, so that I don't need to poll the server. Does Outlook.com provide such functionality?
That API has been deprecated.
You must use: microsoft graph
Outlook provides webhooks via what they call push notifications. You'll find details on this API in the Outlook Push Notifications REST API reference. The capability exists to receive events for a wide variety of resources, including email messages in Outlook.com.
You might also find some useful capabilities for notification of changes to messages with Use the Microsoft Graph API to get change notifications and Keeping messages and mail folders up to date in apps.

Mirror API send timeline item to particular user

I need to send timeline item to particular subscribed user using Mirror API. I have the user's email id. How can I achive this?
Thanks
Update:
I have GDK app, companion app(which runs on Android mobile device) and Mirror API app. Both GDK app and companion paired via Bluetooth. My use case is I have to send timeline item to uesr if he reached particular location. We are using ibeacon to check user's location. When user reached that particular area, companion app detect it(via bluetooth) and send request to mirror app then mirror app will add timeline item to user's glass. Here my question is how to add the timeline item to one particular user?(not to all subscribed users) And what parameter should I pass to mirror app from companion app?(I was thinking to send the user's email id)
The user will have needed to log into your service using OAuth2 and have granted specific permission for you to access their timeline using the role https://www.googleapis.com/auth/glass.timeline. You should request "offline" access so you will receive both an auth token and a refresh token, which you can use to get a new auth token after an hour.
You will need this auth token when you send a card to the timeline, which also serves as an identifier in this case. Having their email id is not enough, and you don't need it.
See https://developers.google.com/glass/develop/mirror/authorization for some code samples and details.
Update:
So it sounds like you have the following overall work flow:
User creates an account on your website (which is where the Mirror API app is hosted). As part of this, they authorize access to their Glass and either give you their email address or authorize you to get it via Google's API.
You'll store this information (auth_token and refresh_token) in a data store somewhere, indexed against their email address.
They will also install your app on their phone, and it has access to the email address as well.
When the mobile app detects an ibeacon marker it is interested in, it connects to your web service and sends the email address and location.
Your web service looks up the email address, gets the access token to authenticate the connection to the Mirror service, and sends a message to Glass with the location information.
This is a generally reasonable workflow, but there are a couple of important points to make:
The Mirror API is well tuned to sending things to just one person at a time. You sound worried about sending bulk results, but as long as you use the auth token for just one user, it will send it to just that user.
You're using the email address as an index to the entire user account. While this is simple to implement, this is not the best solution, since it means that anyone who has a person's email address and the URL for the endpoint of your service can fake locations. You may consider this an acceptable risk given how you're using the location information (sending it back to the user), but you need to think about how the service could be misused.
You can mitigate the risk in a couple of potential ways:
Instead of an easily guessable email address, you can create and use some other userid which the user will need to enter when they first setup the companion app.
The first time (and only the first time) the app wants to connect to the service, it creates and sends a random secret string which it will use as a password and the web service could store this random string. Afterwards, the companion app would need to send this string along with the email address.
Depending on your needs, you could cut out the webapp completely and have the companion app use the Mirror API directly. This would leave the auth tokens on the phone and would greatly reduce the potential chance to have someone spoof your user. It does have a significant downside - although you can use it to send cards to Glass, it becomes more difficult to get responses from Glass back to the companion device.
As I understand your question and comments above, your user has already authenticated with your Mirror API based application, so you already have the required credentials (auth/refresh tokens). Your companion Android application detects a condition (user in a particular area) and sends a request to your remote endpoint in your Mirror API based application.
The companion app, when sending the request to the remote endpoint, needs to send a common piece of information that can be used to identify that user in your Mirror API app. In this case, you're saying you're sending the users email id.
To send a timeline card to only that particular user, I would take the email id that the companion application has sent, query your database to return the credentials that you saved when the user authenticated originally with your Mirror API based app and then use that to create an authenticated Mirror API request that inserts the timeline item for only that user. I don't know what your Mirror API app is written in, but a basic example in Python might take the following form:
# You sent along the email address
userid = notification['MyCompEmailId']
# set timeline card body
timelinecard_body = {
'notification': {'level': 'DEFAULT'},
'text': "You found a beacon!",
'menuItems': [{'action': 'DELETE'}]
}
# Look up the user in our database and
# get their credentials
#
# _credentials_for_user() basically does a "WHERE userid = 'something'" query
user_credentials = _credentials_for_user(userid).get()
# Create a Mirror API service with some credentials.
authed_mirror_service = build('mirror', 'v1', http=user_credentials.authorize(httplib2.Http()))
# Send a timeline card
authed_mirror_service.timeline().insert(body=timelinecard_body).execute()

"Anonymous" throttling in wso02 api manager?

We're looking to replace an existing API manager with wso2 and one of the features of the other platform is that we can identify a 'user' of the API at run time and have the throttling work.
The 'user' is not OAuth identified, rather they authenticate via the API and a session id is returned (so they've never registered at a 'store'). This session id is then used to setup the throttling at the API Manager. Additionally the other tool has code to look for the user logging in and using that id in the throttling. so if a user tries to login too many times per hour the API manager blocks the request in addition to too many requests for a logged in user per hour. The combinations of login attempts, API calls etc. are summed into the throttle. (All this was implemented by their services team years ago)
The main reason we need this is we don't want to force our old clients to go to OAuth immediately but want much more visibility, reporting and throttling.
Thoughts on how to do this with wso2? I see where we can add our own Handlers to the API to figure out session ids, login ids etc. but I don't see where to create the logic to do the throttling.
Thanks,
Chris
Login to Carbon and edit the tiers.xml (/_system/governance/apimgt/applicationdata/tiers.xml)。You can found the section <throttle:ID throttle:type="ROLE">Unauthenticated</throttle:ID>

how to send SMS to a mobile phone using software program (like yahoo messenger)?

I am trying to write a small program using Qt to send SMS messages to a mobile phone. Something like what Yahoo Messenger provides. You can send SMS messages to mobile phones if mobile service provider is supported. I would like to know what happens behind the scenes after you click "Send". Especially how does the message you send gets transfered from the server at yahoo to mobile service provider's network?
Yahoo would've purchased access to (or run their own) SMS gateway. The exact method of transferring the message from Yahoo->Gateway would depend on the gateway's API. Could be XML, could be a proprietary binary format, could be a simple HTTP POST, etc... The SMS gateway would take care of the details of getting the message into the back-end cellular data network and on to the recipient's provider's system.
The easiest way to do it is to buy credit with a company like SMS Global ( http://www.smsglobal.com/global/en/ ). I don't work for them, but I have used them in the past. You do a simple web request (with your account number), destination phone number and the message. It deducts credits each time you send an SMS. Obviously, you write it in to your business plan to cover the costs of this :)
They also offer services whereby you can receive SMS messages to your own web service.
Obviously, there are many other SMS gateways, but if you look at the site and the API you should have a general idea of how it works.