Closed margulesgroome closed 2 years ago
Hi @margulesgroome can you give us details about what endpoint you're calling?
Hi
Can you please clarify what you mean with endpoint ?
Thank you Rudolf
Margules Groome Consulting Pty Ltd Scottish House Level 4, 90 William St Melbourne, VIC, 3000, AUSTRALIA Tel: +61 3 8199 7937 Mobile: +61 (0) 400 144 742 Skype: rudolf_van_rensburg
@.***http://www.margulesgroome.com/
From: Jonas Adler @.> Sent: Wednesday, 12 October 2022 5:20 PM To: swop-cx/swop @.> Cc: Rudolf van Rensburg @.>; Mention @.> Subject: Re: [swop-cx/swop] lexical error: invalid char in json text (Issue #1)
Hi @margulesgroomehttps://github.com/margulesgroome can you give us details about what endpoint you're calling?
— Reply to this email directly, view it on GitHubhttps://github.com/swop-cx/swop/issues/1#issuecomment-1275649271, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3SBI5BTRLVM6IW3RB7HY6LWCZKAFANCNFSM6AAAAAARC5TFCY. You are receiving this because you were mentioned.Message ID: @.**@.>>
Hi Rudolf, are you using the REST or the GraphQL API? Can you give me details about the request/query you're executing? Thanks!
Hi,
We are using an R environment to call the swop API. Below the code we are using. As indicated this code has been running well for ~2 years but stopped working on 18 Sept.
CurrencyList <- c('AUD','BRL','CLP','CNY','EUR','GBP','JPY','MYR','NZD','UYU','VND','ZAR') # List of quote currencies
ResultDF<- data.frame() # empty dataframe as output holder
for(i in 1:length(CurrencyList)) # loop 1 {
LastAvailableFXDate <- sqlQuery(ch,paste("SELECT MAX(quote_date) AS LastAvailableFXDate FROM forex.daily_fx WHERE forecast = 0 and quote_currency = '", CurrencyList[i], "'", sep=''))
StartFXQueryDate <- as.Date(LastAvailableFXDate[1,1],format="%Y-%m-%d")+1
DateList <- seq(StartFXQueryDate, MaxQueryDate, by = "days") # List of dates
for(h in 1:length(DateList)) # loop 2
{
APIQuery <- paste(https://swop.cx/rest/rates?date=,DateList[h],"&base_currency=USD"e_currencies=", CurrencyList[i], sep='')
#print(APIQuery)
result <- GET(APIQuery,add_headers(Authorization = paste("ApiKey", apiKey)))
jsonResponseText <- content(result,"text", encoding = "ISO-8859-1")
Data = fromJSON(jsonResponseText)
ResultDF<-bind_rows(ResultDF, Data)
Regard Rudolf
From: Jonas Adler @.> Sent: Wednesday, 12 October 2022 6:15 PM To: swop-cx/swop @.> Cc: Rudolf van Rensburg @.>; Mention @.> Subject: Re: [swop-cx/swop] lexical error: invalid char in json text (Issue #1)
Hi Rudolf, are you using the REST or the GraphQL API? Can you give me details about the request/query you're executing? Thanks!
— Reply to this email directly, view it on GitHubhttps://github.com/swop-cx/swop/issues/1#issuecomment-1275698520, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3SBI5HJRHLX4C55RDYFAVLWCZQPDANCNFSM6AAAAAARC5TFCY. You are receiving this because you were mentioned.Message ID: @.**@.>>
I just tried the request and it works fine. I also checked our logs and couldn't find our service responding with a 504. Could it be that something in you network changed. 504 indicates a gateway timeout. This could come from a firewall or proxy.
We didn't deploy any changes around the 18th of Sept.
Jonas
Thank you – we think we just found the issue, a change of directory structure on our server that was caused by 3rd party software.
Thank you for your prompt responses and willingness to assist.
Best regards Rudolf
From: Jonas Adler @.> Sent: Wednesday, 12 October 2022 6:32 PM To: swop-cx/swop @.> Cc: Rudolf van Rensburg @.>; Mention @.> Subject: Re: [swop-cx/swop] lexical error: invalid char in json text (Issue #1)
I just tried the request and it works fine. I also checked our logs and couldn't find our service responding with a 504. Could it be that something in you network changed. 504 indicates a gateway timeout. This could come from a firewall or proxy.
We didn't deploy any changes around the 18th of Sept.
— Reply to this email directly, view it on GitHubhttps://github.com/swop-cx/swop/issues/1#issuecomment-1275716638, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3SBI5DUHZFTSVNTW6AV2DDWCZSOPANCNFSM6AAAAAARC5TFCY. You are receiving this because you were mentioned.Message ID: @.**@.>>
You're very welcome, Rudolf! I'll close this issue for now, let me know if you run into any other issues.
Hi, as of about 18 Sept we receive this following error message when retrieving data via the swop.cx API:
Error: lexical error: invalid char in json text.