Καλησπέρα! σε αυτόν των κώδικα που βάζουμε το
API
π.χ
url = "http://attenzoservices.com/api_http2/http?"
myarr1 = Array("user", "pass", "from", "text", "to", "text")
myarr2 = Array("εδω το user", "εδω ο κωδικος", sender, Sms, txt_receiver)
reply = send(url, myarr1, myarr2)
Option Compare Database
Option Explicit
Private Function GetSMSServerResponse( _
strMessage As Integer, _
strFrom As String, _
strUserName As String, _
strPassword As String, _
strTo As String, _
Optional strRequestType As String = "POST" _
) As String
strMessage = Replace(Trim(strMessage), " ", "%20")
Me.SMSPost1.From = strFrom
Me.SMSPost1.Message = strMessage
Me.SMSPost1.username = strUserName
Me.SMSPost1.password = strPassword
Me.SMSPost1.sTo = strTo
Me.SMSPost1.sRequestType = strRequestType
Me.SMSPost1.SendSMS
GetSMSServerResponse = SMSPost1.SMSResponse
End Function
'-----------------------------------------------------------------
Private Sub cmdSendSMS_Click()
Dim strSQL As String
Dim rsSource As DAO.Recordset
Dim rsResponse As DAO.Recordset
Dim strResponse As String
strSQL = "SELECT * FROM Customers WHERE BlnCheck=-1"
Set rsSource = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
If rsSource.RecordCount Then
rsSource.MoveFirst
strSQL = "SELECT * FROM tblServerResponses"
Set rsResponse = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
While Not rsSource.EOF
strResponse = GetSMSServerResponse( _
Nz(Me.txtMessage), _
Nz(Me.txtFrom), _
Nz(Me.txtUserName), _
Nz(Me.txtPassword), _
Nz(rsSource!txtTelefon))
rsResponse.AddNew
rsResponse!dtDate = Now
rsResponse!CustomerID = rsSource!CustomerID
rsResponse!txtResponse = strResponse
rsResponse!txtMessage = Nz(Me.txtMessage)
rsResponse.Update
rsSource.MoveNext
Wend
rsSource.Close
Set rsSource = Nothing
rsResponse.Close
Set rsResponse = Nothing
Else
MsgBox "δεν έχετε τσεκάρει κανένα παραλήπτη!", vbInformation
rsSource.Close
Set rsSource = Nothing
End If
End Sub
Ο κώδικας είναι από τον κύριο Τάσο Φιλοξενίδη και τον ευχαριστώ