Interface with REST API (1 Viewer)

JohnPapa

Registered User.
Local time
Today, 17:54
Joined
Aug 15, 2010
Messages
954
I was wondering whether Access can interface with a REST API and use its methods etc?

I will get hold of the API shortly.
 

isladogs

MVP / VIP
Local time
Today, 15:54
Joined
Jan 14, 2017
Messages
18,216
Yes. I have several examples of apps that do so e.g. a currency exchange tracker, apps that send & receive both text and voice messages ...etc.
 

JohnPapa

Registered User.
Local time
Today, 17:54
Joined
Aug 15, 2010
Messages
954
Hi isladogs, di you point out any of the examples, as namliam did? Thanks in advance.
 

isladogs

MVP / VIP
Local time
Today, 15:54
Joined
Jan 14, 2017
Messages
18,216
Hi John
The Currency Exchange Rate Tracker is available free in ACCDE format from CERT - Mendip Data Systems. Source code can be purchased at a low cost if it helps

The messaging features are primarily used as part of a large commercial app for schools School Data Analyser - Mendip Data Systems. Although I can't provide the full code, I have discussed many aspects of it in considerable detail in various threads at AWF and other forums. For example, this lengthy thread describes much of the process I went through: Using Twilio with Access to send & receive text & voice messages | Access World Forums (access-programmers.co.uk). It also has links to the various articles and the API I used as part of that code

However, there are numerous examples of Access apps that use APIs many of which are used to obtain data from online sources.
It might help if you said which APIs you want to use as someone may have already looked at them
 

JohnPapa

Registered User.
Local time
Today, 17:54
Joined
Aug 15, 2010
Messages
954
Hi all,

Actually in one of the applications which I have developed I use functionality where the software communicates with the Web and if I place a specific file in a specific folder. If this file exists then the user is not allowed to proceed. I use it if I want to disable use of a specific software package:

The software uses late binding "Dim httpReq As Object"
If you do not want to use late binding use "Dim httpReq As MSXML2.XMLHTTP60" and include in References the specific XML Reference


Public Function fblnCheckSerial(strSerial As String) As Boolean

On Error GoTo ErrorHandler
Dim httpReq As Object 'MSXML2.XMLHTTP60
Set httpReq = CreateObject("MSXML2.ServerXMLHTTP")
httpReq.Open "GET", "http://Specific File Name", False
httpReq.send
If httpReq.Status = 404 Then
fblnCheckSerial = False
Else
fblnCheckSerial = True
End If
Exit Function
ErrorHandler:
MsgBox "unexpected error"

End Function
 

JohnPapa

Registered User.
Local time
Today, 17:54
Joined
Aug 15, 2010
Messages
954
Also, I dug up another software I wrote for sending SMS,

Public Function SendSmsViaWebHttpRequest(suniqueid As String, smob As String, smsg As String, sheader As String, sdatetimesend As String, slogin As String, spwd As String) As String
On Error GoTo ErrorHandler
' Dim httpObj As MSXML.XMLHTTPRequest
Dim httpObj As Object

Dim X As Long
Dim Body As String
Dim surl As String



SendSmsViaWebHttpRequest = ""
Body = ""
surl = Replace(DFN_SEND_MSG_URL, "%MSG%", smsg)
surl = Replace(surl, "%ID%", suniqueid)
surl = Replace(surl, "%MOB%", smob)
surl = Replace(surl, "%HEADER%", sheader)
surl = Replace(surl, "%DATETIME%", sdatetimesend)
surl = Replace(surl, "%LOGIN%", slogin)
surl = Replace(surl, "%PWD%", spwd)


'Set oHttp = CreateObject("Microsoft.XMLHTTP")

Set httpObj = CreateObject("Microsoft.XMLHTTP")


' Set httpObj = New MSXML.XMLHTTPRequest

Call httpObj.Open("POST", surl, False)
Call httpObj.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
Call httpObj.send("") '(Body)
SendSmsViaWebHttpRequest = httpObj.responseText
Set httpObj = Nothing
Exit Function
ErrorHandler:
MsgBox "SendSmsViaWebHttpRequest : " & Err.Description & " - " & Err.Number
End Function
 

isladogs

MVP / VIP
Local time
Today, 15:54
Joined
Jan 14, 2017
Messages
18,216
OK so you're clearly experienced with the use of HTTP GET/POST/SEND.
What I'm unclear about is where you need assistance from anyone here. Also you still haven't said which REST API you want to use
 

JohnPapa

Registered User.
Local time
Today, 17:54
Joined
Aug 15, 2010
Messages
954
OK so you're clearly experienced with the use of HTTP GET/POST/SEND.
What I'm unclear about is where you need assistance from anyone here. Also you still haven't said which REST API you want to use
Thanks for your reply. I was unaware I dealt with it in the past. Regarding the API, I am still waiting for it. The client is a dentist, who may need to report Expenses and Income to the government. If you are interested, our desktop software was developed in Access www.VisualDentist.com
and we also have a cloud based version developed in .net using SQL Server on Azure (visualDentist.dentist).

Once I have the API, I will let you know.
 

john_gringo

Registered User.
Local time
Today, 17:54
Joined
Nov 1, 2011
Messages
87
hi John are you trying to send the invoices to AADE. I'm from Greece trying to do the same. :)
 

Users who are viewing this thread

Top Bottom