Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to the FileMaker Data API

Introduction to the FileMaker Data API

Accessing data through REST is the current best-practice for data sharing. That’s not always been easy with FileMaker. Until now! In version 16 FileMaker introduced the FileMaker REST API which allows far easier integration of FileMaker with other systems.

In this session we’ll start from the beginning, looking at what REST is, why we might be interested in using it, how to configure FileMaker Server and a custom app to use the REST API and then begin interacting with our data.

Finally we’ll take a look at some simple examples of the way the API can be integrated into existing environments.

Steve Winter

October 22, 2019
Tweet

More Decks by Steve Winter

Other Decks in Technology

Transcript

  1. Introduction to the FileMaker
    Data API
    Steve Winter
    Matatiro Solutions

    @steveWinterNZ

    View full-size slide

  2. @SteveWinterNZ
    - FileMaker, web application and software developer >20 years!

    - Run Matatiro Solutions

    - Regular DevCon speaker

    - Active Open Source developer
    Who am I?
    Steve Winter

    View full-size slide

  3. @SteveWinterNZ
    Introduction to the FileMaker Data API
    Expectation management

    - This is a beginner session!

    - That said, it will move quite quickly

    - Demo file and code to replicate everything I do

    - First presented at DevCon 2018

    View full-size slide

  4. @SteveWinterNZ
    Topics to cover
    An introduction to REST

    Where REST and CRUD meet

    Our friendly Postman

    Authentication and tokens

    Configuring FileMaker Server and a FileMaker custom app

    Interacting with other systems

    View full-size slide

  5. @SteveWinterNZ
    The end at the beginning
    FileMaker based inventory management

    WordPress based website

    Want to be able to display product data, prices, availability etc on site

    WordPress plugin is available for you to use

    View full-size slide

  6. @SteveWinterNZ
    Demo

    View full-size slide

  7. @SteveWinterNZ
    An introduction to REST

    “”
    Wikipedia
    Representational State Transfer (REST) is an architectural style
    that defines a set of constraints and properties based on HTTP.

    Web Services that conform to the REST architectural style, or
    RESTful web services, provide interoperability between computer
    systems on the Internet.

    View full-size slide

  8. @SteveWinterNZ
    An introduction to REST
    REST-compliant web services allow the requesting systems to
    access and manipulate textual representations of web resources
    by using a uniform and predefined set of stateless operations.


    “”
    Wikipedia

    View full-size slide

  9. @SteveWinterNZ
    HTTP methods
    GET


    “”
    Wikipedia
    The GET method requests a representation of the specified
    resource.

    Requests using GET should only retrieve data and should have
    no other effect.

    View full-size slide

  10. @SteveWinterNZ
    HTTP methods
    POST


    “”
    Wikipedia
    The POST method requests that the server accept the entity
    enclosed in the request as a new subordinate of the web
    resource identified by the URI

    View full-size slide

  11. @SteveWinterNZ
    HTTP methods
    PATCH


    “”
    Wikipedia
    The PATCH method applies partial modifications to a resource.

    View full-size slide

  12. @SteveWinterNZ
    HTTP methods
    DELETE


    “”
    Wikipedia
    The DELETE method deletes the specified resource.

    View full-size slide

  13. @SteveWinterNZ
    Resource URI and FileMaker
    Begin with https://, then

    - C POST /fmi/data/v1/databases//layouts//records

    - R GET /fmi/data/v1/databases//layouts//records/

    - U PATCH /fmi/data/v1/databases//layouts//records/
    - D DELETE /fmi/data/v1/databases//layouts//records/

    View full-size slide

  14. @SteveWinterNZ
    Demo

    View full-size slide

  15. @SteveWinterNZ
    Video CRUD.mov goes here

    View full-size slide

  16. @SteveWinterNZ
    A word of caution
    The FileMaker Data API URIs use the internal recordID of a record

    FileMaker recordIDs won’t always refer to the same record

    This makes the stateless part of REST very important

    View full-size slide

  17. @SteveWinterNZ
    But what about security?
    Don’t Panic

    View full-size slide

  18. @SteveWinterNZ
    But what about security?
    1. You have to enable the FileMaker Data API on your server

    2. You have to enable the fmrest extended privilege for at least one
    user

    3. That user has to authenticate before they can use the API

    View full-size slide

  19. @SteveWinterNZ
    Enable FileMaker Data API
    Demo

    View full-size slide

  20. @SteveWinterNZ
    Video EnableDataAPI.mov goes here

    View full-size slide

  21. @SteveWinterNZ
    Data usage
    Included in your server license

    Number of users x 2Gb per month x 12 months = annual allowance

    3 users x 2Gb per month x 12 = 72Gb

    Outbound traffic only

    Aggregated across all users, not just those who use the FileMaker
    Data API. Error 953 when exceeded.

    Can purchase additional data if necessary

    View full-size slide

  22. @SteveWinterNZ

    View full-size slide

  23. @SteveWinterNZ
    Enable the fmrest extended permission
    Demo

    View full-size slide

  24. @SteveWinterNZ
    Video EnablePermissions.mov goes here

    View full-size slide

  25. @SteveWinterNZ
    That user has to authenticate
    Demo

    View full-size slide

  26. @SteveWinterNZ
    Video Authenticate.mov goes here

    View full-size slide

  27. @SteveWinterNZ
    Putting it all together
    We know what REST is

    Our server is ready

    Our app file is ready

    We have a user with the right credentials

    Let us go forth and connect with the world!

    View full-size slide

  28. @SteveWinterNZ
    Connecting WordPress
    Demo

    View full-size slide

  29. @SteveWinterNZ
    Using FileMaker Go to connect
    Demo

    View full-size slide

  30. @SteveWinterNZ
    What else can we do
    Call scripts

    Upload container content

    Logout

    Fetch ValueLists (since v18)

    Gather other metadata (since v18)

    View full-size slide

  31. @SteveWinterNZ
    Connecting from JavaScript
    Demo

    View full-size slide

  32. @SteveWinterNZ
    Upload container content
    Demo

    View full-size slide

  33. @SteveWinterNZ
    FileMaker Data API documentation
    https:///fmi/data/apidoc

    View full-size slide

  34. @SteveWinterNZ
    Integration resources
    Lots of ‘packages’ to help make things easier

    - See: https://community.filemaker.com/docs/DOC-9197

    - FileMaker: examples in the demo files for this session

    - JavaScript: see the resources for this session

    - PHP: by Mark Denyse, https://github.com/driftwoodinteractive/fmPDA

    - .NET: by Wim Decorte, https://github.com/wimdecorte/FMdotNet__DataAPI

    - Python: by David Hamann, https://github.com/davidhamann/python-fmrest

    - node.js:

    • feathers: by Todd Geist, https://github.com/geistinteractive/feathers-filemaker

    - WordPress: see resources from this session

    - NativeScript: see resources from this session

    View full-size slide

  35. @SteveWinterNZ
    Questions?

    View full-size slide

  36. @SteveWinterNZ
    Session Materials
    https://bit.ly/fds-dapi

    View full-size slide

  37. @SteveWinterNZ

    View full-size slide