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.

Featured Replies

Hi,

I find my self hitting the wall, again and again, trying to make a POST call to an API using Insert from URL curl. When I try the code in POSTMAN it works very well, but trying to translate the curl options into Filemaker is where I fail. This is my POSTMAN code:

curl -X POST \
  https://www.correosexpress.com/wpsc/apiRestSeguimientoEnvios/rest/seguimientoEnvios \
  -H 'user: username:passowrd' \
  -H 'Content-Type: application/xml' \
  -H 'Postman-Token: ff84b952-74c8-f06b-976d-f860d9d66de7' \
  -d '<?xml version='\''1.0'\'' encoding='\''UTF-8'\''?><SeguimientoEnviosRequest xmlns:xsi='\''http://www.w3.org/2001/XMLSchema-instance'\'' xsi:noNamespaceSchemaLocation='\''SeguimientoEnviosRequest.xsd'\''><Solicitante>x</Solicitante><Dato>xxxxxxxxxxxxxxxxx</Dato> </SeguimientoEnviosRequest>'

The yellow part is what I should put under "Body" and after in "raw" in POSTMAN and it is just that the one I can not figure out how to put it as a curl option for the Insert from URL... :(. I pass authorisation using username and password, but I get all the time the same error of missing "XML entry template" 

Any idea on how to overcome this error? is the XML entry template the headers that this api needs to have them custom?

Thanks a lot!!!

  • Author

Ok... After LOTS of testing I figure out how it should be done, so I am just updating my own post to share the info in case anyother "amateur" developer as myself would encouter similar challenge :)

I just figure out how to pass that "-d" data with the XML code, what I did was:

1) Create variable ( $rawdata ; <?xml version="1.0" encoding="UTF-8"?> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SeguimientoEnviosRequest.xsd"><Solicitante>1</Solicitante><Dato>xxxxxxxxxxxxxxxx</Dato> </SeguimientoEnviosRequest>)

2) I was using the lumifire example for CURL testing (  https://luminfire.com/2017/06/12/curling-filemaker-16/)  and on the $options variable that is set on their script I just added an extra curl option as: " -d " & "\"" & Substitute ( $rawdata; "\""; "\\\"" ) & "\""

3) FEEL THE JOY!!!!! when I get the XML info back :)

Thanks a lot,

Best regards!

 

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.