How to receive sms on asp.net using nexmo service - sms

I need some guidance on what steps I should follow to receive sms messages using service from www.nexmo.com.
I am not familiar with asp.net but I am very familiar with C# on windows, so please if you can provide a few steps to get me going then I can pick it up from there. Right now I have an account at www.godaddy.com, so I am hoping I can write the code to place it there. I don't really need much details on how to use nexmo service, I mainly need to know what I should do on my web site to receive sms from nexmo.

Incoming SMS's are simply HTTP requests to your 'page'. Nexmo send's the SMS and related data just like a HTML from submits data to a URL using a GET (query string) or POST (form encoded),
So all you have to do is point Nexmo to the URL you want to use, and check the incoming request for the data. Here's the documentation for incoming messages.
Here's a community authored C# library that might be be helpful.
(Disclaimer: I do a bit of developer evangelism for Nexmo.)

Related

Slack - Interactive button with authentication

What I'm trying to accomplish?
Send an API (chat.postMessage) from a 3rd party app to a Slack user - Done
The message will have two buttons (approve and decline) which the user can click on - Done
Upon clicking on one of the buttons, Slack should send an API back to the 3rd party app - TBD
Before sending an API, Slack should retrieve an authentication token via API - TBD
Note: I've seen in Slack docs mentioning of /incoming endpoint (also /interactive-message). My 3rd party app has a strict set of available APIs. I'm not able to create new API endpoints. Also, I need the payload to be sent in a specific JSON structure.
I've reviewed Slack documentation but I can't figure it out.
Making notifications actionable
I'm technical but not a developer so there might be nuances which I'm missing.
Is there any section in Slack where I can add custom code to accomplish such integration?
If not, how I can accomplish it?
Edit:
I've configured a Request URL (in slack), when I click on one of the buttons in the message, I can see an API request is being sent to the URL.
I'm able to see the payload as well.
My problem is that I need the information to be sent in a different format and to a different endpoint.
What is the best approach to take for this? Do I need to develop a new service to capture and parse the payload and then generate the API request to my 3rd party app?
Ok, so here is how I've accomplished it.
Upon clicking a button in slack, Slack sends an API with a certain payload to the predefined endpoint which you configure (Request URL).
I've used free tier AWS serverless components:
API Gateway and Lambda
API gateway receives the payload and invokes the Lambda function (I used Python as it seems the easier for a non developer)
My Lambda function is processing the payload and has the logic to interact with my 3rd party app in the required way.

How to work in Laravel app with external api?

in my Laravel 5.7/mysql app I need to make external api to read some data from external
app with get request and to write some data to my db with post request.
Which tools/scripts are there for this and how to make these requests safe?
MODIFIED :
Thanks for feedbacks, but looks like I badly put my question
The external app(I do not know what is it written with) need to read data from my app
and write data to my Laravel 5 app.
And how have I to test these requests while on development locally ?
Looks like I have to use Guzzle as in provided link?
Which steps have I to take for safety on my side?
Thanks!
These three libraries are popular for your use-case:
Guzzle
Curl
zttp
If the database is local you can use Eloquent, If not, remote connection to that database may help. otherwise, if you only have API access you should consume eighter of above libraries or any alternative options to make an HTTP request your application might require.
Security-wise, as long as you are only making a request to a remote server, the Suggested way is to store any key or secret string related to authorizing your request (if applicable) in your .env to prevent it from committed to your version control systems. Needless to say to always handle any possible HTTP error your remote API might throw in order to prevent any unwanted error on your application side.
And as Abir Adak mentioned in the comment check this thread for further details.
Updated Answer: On the case of MODIFIED part, generally you have 3 popular options,
REST API
This blog post is a detailed walkthrough written for Laravel
This one from Stack Overflow can help you with designing you API
This last one can help you to develop a widely accepted API response and endpoints by following its specifications.
GraphQL
Can save some time for developing your API, but I suggest to make sure that the consumers of your API are happy to use this option.
GraphQ
Laravel Package for GraphQL
If using Laravel isn't a must, and you are using PostgreSQL, you might want to look at Hasura as well.
SOAP
Have little knowledge on this option for Laravel, just know folks coding using C# and .net are happier to expose their API with this protocol. read more about it on WikiPedia
Postman is a great tool for testing your API or any other API.

Writing A Bot Framework Client

I've been away from BotFramework development for a while and have now come back to it.
I am using this Bot hosted internally within my company, and talking to it using a relay application using REST. This all worked fine.
However, after updating to V3 of the Bot Framework I came across issues. I see that the changes mean that the Bot now replies asynchronously, sending data to the ServiceURL field. Therefore I have a couple of questions.
Can I still use this architecture for the Bot Framework? (i.e. hosting internally to the company, without using Azure or Connectors)
If I can, I assume that my relay application will need to have an endpoint that the Bot can reply to? Does it just do a http POST to the ServiceUrl I give it? (i.e. http://mybotserver:9000) or is it posting to a URL under that server address? I assume the body of the post is the usual Json you see in the Channel Emulator.
I don't know the specifics of your architecture, but in general, if your bot (via relay) can:
Reach the ServiceURL endpoint with an https post
Receive incoming requests to an endpoint you registered with the Bot Framework
The relay needs to be able to reach our login service to sign requests
Also needs to be able to reach our OpenId endpoint as part of signing/authenticating
That should be it.

Api and consumer flow

I am developing an API for a social network website. This API will basically get all the requests from the users (get friend list, post a status update etc) and reply back if necessary.
We will implement OAuth 2.0 protocol for authentication. Consumer (our php project) has API id and secret.
Basic scenario:
Client wants to log in
API Consumer (php web project) takes this request, directs user to API
User send his/her user credentials to the api, gets the token.
User comes back to our website, pass token to the consumer.
Consumer goes to the api server, gets the access token.
Now consumer (php project) has access to user's private information.
Since this is a social network website, we want app developers to be able to use our API in the future.
I am not experienced in API-design. Does that flow make sense? I guess the simplest authentication would be accessing user information through php project. But we don't want to access database in php code. We will use ajax in client side and send a request to the API. And I believe there should be a better solution, what would you suggest?
Sure, API design is basically point where you need to choose technology.
Either it can be PHP or .net or Java.
I would prefer either PHP or .Net as we get lot of flexibility in it.
API will return XML or Json depending upon the request.
There are lot of CMS in php which can be helped.
.net we have Service Stack to help you.
API's had to be fully independent from other world as well as within API method as well.
If you are able to achieve this, then you will surely create a good architecture.

Any suggestion for companies or service for global SMS API?

You might used whatsapp or LINE from iOS or Android smartphone.
You need to activate your account but input your phone number at the first time.
And the app will try to send a SMS message to your phone for authentication.
Do you have any suggestion how they achieve this?
As far as I think, there might be some SMS API Service companies to help on that.
If so, do anyone have some suggestions or list for those companies which provide integrated global SMS Service API (via Web API to trigger)
And also if I want to receive SMS message from users, is there any suggested company to help on receiving SMS?
Or is there any better way to achieve similar goals (Sending and Receiving SMS via Web API worldwide)
I know that the company Twilio does it. Check this out http://www.twilio.com/api/sms
What you're talking about is often called as two-factor authorization, mobile verification API, one time password API. We (and me, personally) implemented this as a part of our SMS API.
As a first step, you must generate the code. And after the user received the message and entered it in your UI, you're validating it.

Resources