Hello,
I was following an older thread (updated) on how to fetch currency exchange rates via apiLayer. I have registered and have been provided with an API Key.
Following Don Manfred's example with the update (to include the API Key) I get an error from the API Service "You cannot consume this service".
Can anyone tell me how to structure the Link String correctly?
Thanks
Azhar
I was following an older thread (updated) on how to fetch currency exchange rates via apiLayer. I have registered and have been provided with an API Key.
Following Don Manfred's example with the update (to include the API Key) I get an error from the API Service "You cannot consume this service".
API Call:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("frmSetup")
DownloadRates("https://api.apilayer.com/fixer/latest?apikey=I5prDI8J--------------8Q2i32")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub DownloadRates(Link As String)
Dim job As HttpJob
job.Initialize("", Me)
job.Download(Link)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Log(job.GetString)
ToastMessageShow(job.GetString,True)
Dim parser As JSONParser
parser.Initialize(job.GetString)
Dim root As Map = parser.NextObject
Dim date As String = root.Get("date")
Dim rates As Map = root.Get("rates")
Dim SGD As Double = rates.Get("SGD")
Dim MYR As Double = rates.Get("MYR")
Dim GBP As Double = rates.Get("GBP")
Dim AUD As String =root.Get("base")
Log($"The ${AUD} is worth ${SGD} Singapore Dollar on ${date}"$)
Else
Log("Error: " & job.ErrorMessage)
ToastMessageShow("Error: " & job.ErrorMessage, True)
End If
job.Release
End Sub
Can anyone tell me how to structure the Link String correctly?
Thanks
Azhar