How to integrate BurstSMS API into asp.NET application? - asp.net-mvc

I have situation that if anyone send SMS to my virtual number(CallerID) the BurstSMS API will call my handler which get the response from query string and proceed further.
So, I want to know only that ,how and which things needed to integrate the BurstSMS API in my APS.NET application.
I couldn't find the information from the documentation of API site and as well as not any article on the google.
Thanks in advance.

This is what you need to do.
Log in to your account
Go to Messaging -> Keywords
Click Edit from the Actions column of the campaign you would like to receive responses for
In the form which pops up fill in the "Send Response to URL" field with a URL to a script on your server which can process the responses, e.g. www.clienturl.com/sms.php
Click Save
From then on we will forward all SMSes for that campaign to your script with an HTTP GET request. For example, if you send "Property 25" to your longcode, we will call
www.clienturl.com/sms.php?mobile=61430008230&response=Property+25
From that you can see the parameters we use.
You could also add other parameters your own reference such as the longcode or an internal client id by using a different URL in the "Send Response to URL" field, e.g.
www.clienturl.com/sms.php?longcode=61418499440&client=123
In which case we would send to you
www.clienturl.com/sms.php?longcode=61418499440&client=123&mobile=61430008230&response=Property+25
Source burstsms

Related

How to do a server to server response to a POST

I am working on an old classic asp site that uses vbscript for the server code and HTML and JavaScript for the client end. I am communicating with an external server which handles the credit card payment details.
I have found loads of answers for getting the response from a POST to the server (both from the client using JavaScript and from our own website server using vbscript). However what I am failing to find is how to respond from my server to an POST made from the credit card gateway server.
The sequence goes something like this:
I post all the transaction details to the gateway server
They immediately respond with a success status, a security key, a transaction ID, and a URL to which I must immediately redirect.
They then send a 'notification' post to a URL, that I gave in the first post, with an MD5 hash made up from details of the transaction and, importantly, the security key. I must generate the same MD5 hash and check that it matches. This is obviously to confirm that the initial transaction has not been compromised in any way.
Having done the security check I am required to respond: "When we receive your response to our notification POST, we determine where to direct your customers browser based on your response Status:"
That last stage is the one I am struggling with. I'm sure it's something really simple and silly but I just can't find any information anywhere. I have found lots of stuff on HTTPResponse but that all seems to be getting the response from a POST that I have made (and I have used this in the earlier stages) whilst here I am wanting to generate a response to a POST I have received. Note this must all be done at my server end as the credit card gateway have the IP address of our server and will only accept these transactions from that IP address therefore none of this can be sent from the customer's browser.
Sorry if this is really dumb! I am a C++ developer not a web developer but, as is the way with these things, I am having to do this bit of web development!
What you are talking about here is a consumer (the Gateway server) sending a POST request to an endpoint on your web application, which you should handle just the same as if you were receiving a POST from a local request, the process is the same.
Here is a basic example;
<%
'Expect only POST data to this page
If UCase(Request.ServerVariables("REQUEST_METHOD") & "") = "POST" Then
'Craft your response
Call BuildResponse()
Else
'Anything other then a POST should be met with a 404 response.
Response.Status = "404 Not found"
End If
Call Response.End()
'Sub for crafting your response.
Sub BuildResponse()
'Do we have a form field of "somevalue" with a value of "yes"?
If LCase(Request.Form("somevalue") & "") = "yes" Then
Call Response.Write("Hello world - Valid")
Else
Call Response.Write("Hello world - Invalid")
End If
End Sub
%>
This is just a basic example that expects a form post parameter of "somevalue" with a value of "yes". Based on this it returns a conditional response.
Obviously, you will need to pad out the response based on your requirements but this should give you some idea of how to structure it.
Side-note: As you won't be the consumer yourself it might be an idea to output a text file or setup an email that reports the passed form parameters to help you debug what the consumer is POSTing to the page to help you work out how to handle the request and generate a valid response the consumer expects.
Useful Links
How to check form submission ASP classic
ASP - Printing the entire request contents
How to create a new text file with asp?

How to programmatically parse emails on an Outlook server and execute a script/task

My intranet web application (written in C#/ASP.Net MVC) sends email notifications in certain situations. I would like to intercept replies to such emails and perform actions based on the content of such replies.
I have no preference for scripting language - it could be Powershell, Python, VBA, anything - as long as I can parse the subject and body of the email, I can then alter the database of my web application through this script and pick up changes with an automated task, but I really have no clue where to start. I would be really grateful if someone could point me in the right direction.
QUESTION
How can I intercept emails sent to the Outlook server and perform action based on the content of such emails?
It sounds like you need an inbound email parsing service. I've worked with the one from SendGrid and it will catch any replies to a specific email address, and then post the email contents to an action on a controller in your MVC app. This will give you access to the full email contents and you can process it as needed.
See Setting up Inbound Parse

Where i get Fulfillment URL?

I have tried to create action in google assistance.
I am already adding the name of smart home action and account linking step.
The next step is to add the Fulfillment URL? Where I get this address?
If I want to add action like Light 1, 2,3 on or off where I want to include these details?
The fulfillment URL is the publicly accessible URL that the Google Assistant will call to send commands to turn on and off a bulb, and request service details like the devices that a given user may have.
You should visit and read the smart home documentation to understand how to process the requests and generate responses. You should also check out the sample project to understand how all the pieces fit together.

Send a third-party API request when Case is created

I know in the "Settings > API Integration" I can add a URL that will receive a POST when a Case (Customer Inquiry) is created, however the contents of that POST only contains two IDs e.g. ObjectID=1234567&ObjectType=2001
Is there a way that I can send a custom POST to some URL with the actual form data? E.g. if I wanted to send the person who submitted the form a text message via a third-party SMS API
No; you'll need to respond to that POST with one that extracts the data you need from BC, then transform & forward that data to the SMS service.
This implies that you'll have a third server to handle those intermediary steps.
http://docs.businesscatalyst.com/reference/soap-apis-legacy/crm/case_retrieve.html
Another approach to do this is to write some ajax post function to post form data to the desired URL before submission.

How can I download a OneDrive file with Office365 REST API into a Ruby variable?

I'm building a Ruby on Rails app, and I'd like to integrate some Office365 features.
For instance : I would like to download a file from OneDrive and then attach it to an Email in order to send it via Outlook rest API.
I found this get Item content OneDrive REST API but I dont understand how to use it.
I understand that I have to send a GET request (formated as explained in msdn.microsoft.com) with Rails, which will then provide me a "a pre-authenticated download URL" to download the file.
Then I will have to send a second GET request with this a pre-authenticated download URL to start the download, but I don't understand how to deal with the Response in order to save the file into a variable.
How can I retrieve the file into a variable of my Ruby on Rails App, so that I can attach it to an Email with an Outlook REST API to send it from my own Rail controller ?
Also this workflow is really not optimized in term of Bandwidth and Processing (3 REST API request + 1 download + 1 upload), it will work.
However if it exist a single REST API that direclty attach a OneDrive file to an email to send it, that would ease a lot my life, save energy, save money from Microsoft datacenter, and spare the planet ecology.
Any tutorial, examples, or more explanatory doc would be much appreciated.
--- EDIT ---
Adding link to the email is not wished as the email may have to be send to someone outside of Office365 users, and public link are a security issue for confidential documents.
Any help is welcome.
There isn't a single REST API call you can make currently to do what you want, although being able to easily attach a file from OneDrive to a new email message is a great scenario for Microsoft Graph API, it just isn't supported right now.
If you want to attach the file, you need to do as you mentioned, download the contents of the file, and then upload it again as an attachment to the message.
However, I'd recommend sending a link to the file instead, even though you mentioned you don't want to do that. OneDrive for Business now supports "company shareable links" which are scoped to just the user's organization instead of being available totally anonymously.
Something else to consider: The security concerns of sending an anonymous link aren't that different than sending an attached file. In fact, the anonymous link can be more secure, because access to the file can be monitored and revoked in the future (unlike the attachment, which will always be out there).

Resources