4 Replies Latest reply on Feb 1, 2017 4:40 AM by wimdecorte

    How to pull in data from a PHP API

    doubledex

      Hello -

       

      I'm brand new to Filemaker and new to a lot of the technology I'm currently reading on ODBC, php, cURL, etc.  I have a programming degree but have not used it extensively in the last decade and before that it was mostly for python scripting, C++ for standalone command-line tools.  However, I am good at getting things working if I get a bone to chew on.  What I'm asking for here is some starter help on my "hardest problem" in setting up my Filemaker solution, and that's getting my data in.

       

      I've done the basic Filemaker tutorials and I'm comfortable knowing I will be capable of getting the results I need, but the hard part is pulling in the data I want from the sources I have.  In our business we have ordering data on external sites (Amazon, eBay, PayPal, etc) that I need to pull in to Filemaker.  One of the shipping services we use pulls most of this data in and it's available via a PHP API.  Here's a link to that service's PHP API:

       

      Getting Started · ShippingEasy

       

      I can tell that it's possible for me to turn this in to an object I can access and use, but I really don't know where to start to get that working.  If one of you lovely people could give me an outline of the steps needed to set up something like this, I would greatly appreciate it.  There are so many possibilities with Filemaker that it feels a bit overwhelming to narrow down exactly what the right thing to do is.  A general strategy is what I am looking for, but I would be happy to get a detailed example too.

       

      If I can get this data in to my solution, I will be way ahead in getting this system up an running for us.

       

      Thank you in advance!

      John

        • 1. Re: How to pull in data from a PHP API
          philmodjunk

          Am I correct that you need to make an API call and capture the result returned back from that call?

           

          Insert From URL can be used to make the API call and insert the result into a text field.

           

          There are also a number of plug-ins that can be used that make working with API calls easier to manage.

          • 2. Re: How to pull in data from a PHP API
            doubledex

            Just looking at Insert From URL, it looks like you are collecting one specific field from one record.  I am trying to pull in multiple fields worth of data for many many records.  I essentially want the "import records" functionality with "update matching records in found set" and "add remaining data as new records" set to on, but instead of coming from a file, I want this data imported from this PHP API provided by a third party.  How do I setup the PHP script so that is running and accessible by Filemaker?

             

            What are some of the other plugin options that I might use for this?

             

            Thanks for the patience and answers.

             

            John

            • 3. Re: How to pull in data from a PHP API
              philmodjunk

              You are not limited to sending data from a single field using insert from URL. The URL parameter is a calculation that can pull data from different fields and tables. I've used ExecuteSQL to pull data from multiple records into the needed parameter string.

               

              The RESULT of the API call is inserted into a single field. There are many ways to parse those results from that single field If such is needed.

              • 4. Re: How to pull in data from a PHP API
                wimdecorte

                doubledex wrote:

                 

                What are some of the other plugin options that I might use for this?

                 

                Have a look at the free BaseElements plugin.

                 

                The "insert from URL" will let you do HTTP GET and POST but is limited in that you can not add custom headers, which a lot of APIs require.

                 

                Plugins don't suffer from that same restriction and are usually a better way to go for this kind of integration.

                1 of 1 people found this helpful