Last active
August 29, 2015 13:56
-
-
Save scottbaggett/8853401 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| url: url, | |
| type: "POST", | |
| dataType: "json", | |
| contentType: 'application/json', | |
| data: JSON.stringify(waterfallCredentials), | |
| success: (function(_this) { | |
| return function(response) { | |
| var mobileNum, payload, url; | |
| console.log('successful authentication to waterfall', response); | |
| mobileNum = _this.$mobile.val().match(/\d/g).join(""); | |
| url = 'http://three.waterfallmobile.com/api/v1/messaging/sendContent'; | |
| payload = { | |
| "modules": [ | |
| { | |
| "type": "SUBSCRIPTION", | |
| "params": { | |
| "listId": "52eff91c0cf22e9cd391bd16", | |
| "optInType": "doubleOptIn", | |
| "optInMessage": "Reply Y to Join!", | |
| "confirmMessage": "Thanks. Message & Data Rates May Apply. Text STOP to end" | |
| } | |
| } | |
| ], | |
| "msisdns": [mobileNum] | |
| }; | |
| return $.ajax({ | |
| url: url, | |
| type: "POST", | |
| dataType: "json", | |
| data: JSON.stringify(payload), | |
| success: function(response) { | |
| return log("succesful mobile payload."); | |
| } | |
| }); | |
| }; | |
| })(this) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment