xximjasonxx
xximjasonxx

Reputation: 1222

REST API for Windows Azure Mobile Services

One of the things I enjoy about Parse is the REST API which allows me to send push notifications to "channels" from an external website. I am curious if this, or something similar is available with Windows Azure Mobile Services.

From what I can see, the best way to achieve this result is to create a table which stores push notifications on the Azure Mobile Services. Override the onInsert node.js script to send a push when a record is inserted. The insert is coming through the existing REST API which does allow me to interact with the tablet itself.

What I would like is the ability to provide, for example, my iOS Device Token to the API along with various application access credentials to a REST endpoint and use Mobile Services to send the notification on my behalf, while keeping the information on those clients in my own database hosted in SQL Azure or another location.

Thanks for any insight.

Jason

Upvotes: 2

Views: 1796

Answers (2)

allprog
allprog

Reputation: 16790

The API feature now can be used instead of the virtual tables. More detailed info in this question: How to use the Azure Mobile Service API feature

Upvotes: 0

Chris
Chris

Reputation: 3017

Today this is posible by creating a "virtual" table in Mobile Services which you only use for the scripting layer. Instead of performing request.execute(), you'd just put in the code that calls push.APNS(or whichever platform you're pushing to) to push out to your client. You can use the mssql module to execute a stored procedure or custom sql on the connected database (which could then talk to a different SQL Database if you are storing the data separate from the DB connected to Mobile Services). As far as getting data to the service, just send over any data you need just like if you were going to insert the data into the table (so they will be fields on the ITEM parameter in the insert scripts) or use the optional PARAMETERS parameter when making a call against your MSTABLE object (and they'll be available on the REQUEST.PARAMETERS object in your scripts).

Upvotes: 2

Related Questions