Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Curl BE frustration....

Featured Replies

HI Guys,

I have been at this for hours and my brain (and my body) can't take it anymore.

I have the Base Elements free plugin installed. I tried to go through the docs.

Here's what I'm trying to do: Use an API:

curl --data "api_key=101ab54dbdad0ddca616e3&req_type=allLists" http://api.easysendy.com/ver1/listAPI

(I've changed the API but you get the idea...)

Trying to use "Insert from URL" into a field. (tried container, etc) and nothing works.

I know the API is correct because it works from my cmd prompt on windows) and I get back:

    {"status":"success","count":2,"listsData":[{"list_uid":"nr676yq0mz408","name":"testing","display_name":"test","description":"testing"},{"list_uid":"qn8724ssf1ccb","name":"Test","display_name":"Test","description":"This is a test list to figure out how to use this service."}]}

But I can't for the life of me get filemaker to do it. I tried the BE_HTTP_Get, I tried the Geist generator. I'm lost here.

I can even get FM (through the data viewer) to spit out the correct URL (using "\" for the needed quotes...I just can get any response.)

(connection error from the script debugger)

Any suggestions on how I can send: curl --data "api_key=101ab54dbdad0ddca616e3&req_type=allLists" http://api.easysendy.com/ver1/listAPI

out of filemaker?

Thanks,

Al,I need a beer....or 2 or 3....

 

 

I tried with MBS Plugin:

 

#Start new session

Set Variable [$curl; Value:MBS("CURL.New")]

#Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)

Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; "http://api.easysendy.com/ver1/listAPI")]

Set Variable [$result; Value:MBS("CURL.SetInputText"; $curl; "api_key=101ab54dbdad0ddca616e3&req_type=allLists")]

Set Variable [$result; Value:MBS("CURL.SetOptionUpload"; $curl; 1)]

#RUN now

Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]

#Check result

Set Field [CURL Test::Text; MBS("CURL.GetResultAsText"; $curl; "UTF8")]

Set Field [CURL Test::debug; MBS("CURL.GetDebugAsText"; $curl)]

#Cleanup

Set Variable [$result; Value:MBS("CURL.Cleanup"; $curl)]

 

 

But this gives error about missing public key. 

So question: Why not https?

And could it be you need a SSL client key to connect?

  • Author

@MBS, While it's a great plugin, (heard great things about it), I'm a one man shop, and I use FM just for myself, not a paid developer. i.e. it's too expensive.

I can connect via cmd in windows with no SSL, the key was that I changed the key. I guess it doesn't matter if I put it out there....

curl --data "api_key=101ab54dbdad0ddeabfeb648f914c0b8bca616e3&req_type=allLists" http://api.easysendy.com/ver1/listAPI

Using that in CMD does return the correct response. Just FMP that I can't get it to play. I tried text, container, webviewer. Everything I could google....

@Josh, had not thought of the POST function, but just tried it and no love...

I also just checked with Goya and they want $199 for support. (don't blame them but it's steep for one issue). For that money I would get MBS but I can't really justify the expenditure...Amazing that FMP after 15 versions can't communicate with the web easily...Heck still can't send html email without help. I wonder sometimes that even though I love the emperor, he isn't buck naked...nah, maybe just over filemakered for today.....

 

Edited by Miron

It's just a syntax issue. I do this kind of stuff a lot. I'll test it with your real key and see if I can get it to work.

 

Try this: BE_HTTP_POST ( "http://api.easysendy.com/ver1/listAPI"; "api_key=101ab54dbdad0ddeabfeb648f914c0b8bca616e3&req_type=allLists" )

4 hours ago, Miron said:

 

@Josh, had not thought of the POST function, but just tried it and no love...

 

 

There shouldn't be any guessing on that; all APIs (typically) state whether you should use GET or POST to interact with them...

If I run the command line here, I get the error.

So I presume your CURL uses the certificates installed on your computer and the plugin doesn't know about them.

  • Author

@Josh, no love on BE_HTTP_POST ( "http://api.easysendy.com/ver1/listAPI"; "api_key=101ab54dbdad0ddeabfeb648f914c0b8bca616e3&req_type=allLists" )

@Wim, I agree, the api instructions say GET, but at this point I'll try anything...

@MBS I have no idea if that's the case. If it is , then it's a filemaker issue.

If there were only a way, to enter a the pure curl syntax the way it works in CMD without having FM add or subtracting anything from it....

 

 

 

 

 

Can you post the full script that shows how you put together the BE GET call?

11 hours ago, Miron said:

@MBS, While it's a great plugin, (heard great things about it), I'm a one man shop, and I use FM just for myself, not a paid developer. i.e. it's too expensive.

If the plugin is too expensive, you could always contact me and discuss prices. Usually we find a way...

And in contrast to an free plugin, the paid one includes me as full time developer to help people.

  • Author

 

@Wim, I have tried so many combinations (I'm talking I was at this for hours...URL encoded, not encoded, variation, test, etc)

BE_HTTP_GET ( "curl --data" & "" & "\"" & "api_key=101ab54dbdad0ddeabfeb648f914c0b8bca616e3&req_type=allList" & "\"" & " " & "http://api.easysendy.com/ver1/listAPI")

I was trying to duplicate the success with using the cmd.exe, /so I tried switch the order where the HTTP is first, but that doesn't work in cmd.exe and doesn't match the API info...

@MBS, very kind of you. I may just take you up on that. It's a fantastic plugin that makes FMP come alive....

 

 

Your syntax is not correct.  Check out the BE_HTTP_Set_Custom_Header function to set the curl options before using the GET to talk to the URL.

As an aside: set a variable with your request before throwing it at the BE_HTTP_GET function, that gives you a chance to review the complete URL and request in the data viewer before you feed it to the function.

  • Author

@wim, good point, will test and report back....THANK YOU (AND TO EVERYONE ELSE WHO HAS HELPED)

I used that function and it worked fine for me. No need to do anything else. 

Set Variable [ $result ; BE_HTTP_POST ( "http://api.easysendy.com/ver1/listAPI"; "api_key=101ab54dbdad0ddeabfeb648f914c0b8bca616e3&req_type=allLists" ) ]

From there, I could do whatever I wanted. But it returned to me the same list as you demo'ed earlier. What version of the plugin do you have installed?

  • Author
23 minutes ago, Josh Ormond said:

I used that function and it worked fine for me. No need to do anything else. 


Set Variable [ $result ; BE_HTTP_POST ( "http://api.easysendy.com/ver1/listAPI"; "api_key=101ab54dbdad0ddeabfeb648f914c0b8bca616e3&req_type=allLists" ) ]

From there, I could do whatever I wanted. But it returned to me the same list as you demo'ed earlier. What version of the plugin do you have installed?

OMG , this WORKED!!! I don't get what I was doing wrong but I'll take and and give THANKS!!!!

I have version 3.3.4 of the Base Elements (download just a few days ago.

Funny how although it's listed as a GET function in the API docs...it's POST that got it to work.

Really appreciate it Josh. I didn't have the funds to spend on this and was about to abandon the project.

I am very grateful to everyone who contributed and I hope this thread helps someone else who runs into this any curl issues...

Alfred

P.S. I would have sworn I tried that combo... but after a while it's get overwhelming to remember exactly everything tried....

I've been there myself. Glad to hear you have it working now. Spent many an hour with my head in my hands. lol

  • Author

I wanted to add one more thing that might help someone trying to figure this out.

Putting it into a Set variable is what made it work. I was using Insert from URL and never got it to work.

ALL you need is the BE_HTTP_POST and in the variable and that's enough.

Could be that using insert from url adds or modifies the URL sent to where it doesn't work.

Good luck to those who follow in these footsteps....

 

Using Insert From URL may be using a cURL code and sending code inside of code. Which would blow up the syntax. One possibility.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.