AnsweredAssumed Answered

cURL with MyGeodata.cloud

Question asked by theOtter on Dec 14, 2017
Latest reply on Dec 18, 2017 by disabled_ggt667

Full disclosure: I’m a total n00b when it comes to cURL. However, I’ve been tasked with integrating our FileMaker systems with MyGeodata.cloud. I’m fairly certain I’m close at this point, but it’s just not coming together, so the time has come to reach out for help.

 

First of all, I’ll link to the MyGeodata API manual. This is where I got the syntax for the code. Of course, FileMaker 16 is a bit unique in its syntax, so I had to tweak things a bit. Per FileMaker’s instructions, I’m exporting the data to a .csv file, but not attempting to access it directly. I create the .csv, place it in a variable, and act on that variable. So, here’s my code:

 

#Export the values as a CSV file.
Set Variable [ $estNum ; Value: GetAsNumber ( $$est.id ) ]
Set Variable [ $path ; Value: Get ( TemporaryPath ) & "export" & $estNum & ".csv" ]
Export Records [ With dialog: Off ; “$path” ; Unicode (UTF-8) ]
#
#Store the file in a variable.
Insert File [ $file ; “$path” ]
#
#Use MyGeodata.cloud to convert the file to XLSX.
Set Variable [ $curl ; Value: " -F " & Quote ( "key=" & $$myGeodataKey ) & " -F " & Quote ( "format=xlsx" ) & " -F " & Quote ( "outform=url" ) & " -F " & Quote ( "file=@$file" ) ]
#
Set Error Capture [ On ]
Insert from URL [ Select ; With dialog: Off ; $jsonInit ; "http://mygeodata.cloud/api/datasetinfo" ; cURL options: $curl ]

It’s pretty simple, but obviously I’m going wrong somewhere. Anybody have any ideas? (And yes, I know I can export a XLSX fie from FileMaker; this is just a proof of concept.)

 

Thanks so much!

 

* * * * *

 

ETA: I have also tried placing the file in both global and local container fields, and setting the $file variable to that. Still no luck.

Outcomes