{"id":1479,"date":"2018-05-15T13:45:36","date_gmt":"2018-05-15T20:45:36","guid":{"rendered":"https:\/\/app.works\/?p=1479"},"modified":"2022-08-02T15:26:46","modified_gmt":"2022-08-02T22:26:46","slug":"filemaker-17-admin-api","status":"publish","type":"post","link":"https:\/\/app.works\/filemaker-17-admin-api\/","title":{"rendered":"FileMaker 17: Admin API"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">If you manage multiple instances of FileMaker Server, maintenance would typically be performed by logging in to each via a web browser or running fmsadmin CLI commands. These methods become unwieldy when you need to make the same change or gather the same bit of information across several servers. A seemingly simple task now takes 30 minutes or more with multiple servers. For example, ensuring that servers have enabled the security setting \u201cHost password-protected databases only\u201d is a quick task for the first few servers, but surprisingly time-consuming when checking twenty. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The time-saving solution to administering a fleet of Filemaker Server instances is the Admin API. Prior to 17, the Admin API was only available in FileMaker Cloud. Now, FileMaker Server 17 running on Windows or Mac OS can be administered from any tool capable of generating HTTP requests, including curl, PHP, and Filemaker Pro Advanced. Given a list of server addresses, we can programmatically log in to each server to gather configuration information, close database files, run schedules, and more.<\/span><\/p>\n<p><!--more--><\/p>\n<p><span style=\"font-weight: 400;\">To start off, here is the sequence of curl commands necessary to enable the \u201cHost password-protected databases only\u201d setting on a single server:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Obtain a JWT token:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">curl -X POST \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0https:\/\/example.com\/fmi\/admin\/api\/v1\/user\/login \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-H &#8216;Content-Type: application\/json&#8217; \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-d &#8216;{<br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;username&#8221;: &#8220;admin&#8221;,<br \/>\n<\/span><span style=\"font-weight: 400;\">\u201cpassword\u201d: \u201cadmin-password\u201d<br \/>\n<\/span><span style=\"font-weight: 400;\">}\u2019<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Use the JWT token (\u201ca-very-long-string\u201d) to authenticate subsequent requests.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Change the security setting:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">curl -X PATCH \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0https:\/\/example.com\/fmi\/admin\/api\/v1\/server\/config\/security \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-H &#8216;Authorization: Bearer a-very-long-string\u2019 \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-H &#8216;Content-Type: application\/json&#8217; \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-d &#8216;{<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;requireSecureDB&#8221;: true<br \/>\n<\/span><span style=\"font-weight: 400;\">}&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Confirm the new security setting (optional):<\/span><\/p>\n<p><span style=\"font-weight: 400;\">curl -X GET \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0https:\/\/example.com\/fmi\/admin\/api\/v1\/server\/config\/security \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-H &#8216;Authorization: Bearer a-very-long-string&#8217;<br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Logout (also optional, but generally a good idea as only a few admin connections can be open at once):<\/span><\/p>\n<p><span style=\"font-weight: 400;\">curl -X POST \\<br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0https:\/\/example.com\/fmi\/admin\/api\/v1\/user\/logout \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-H &#8216;Authorization: Bearer a-very-long-string&#8217; \\<br \/>\n<\/span><span style=\"font-weight: 400;\"> \u00a0-H &#8216;Content-Type: application\/json&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To make these requests against a list of servers, you just need to programmatically set the host address (e.g. <\/span><a href=\"https:\/\/example.com\"><span style=\"font-weight: 400;\">https:\/\/example.com<\/span><\/a><span style=\"font-weight: 400;\">), username, and password within each curl command. The screencap below illustrates how to achieve this using a FileMaker script. For the purposes of this blog post, I\u2019ve hard-coded and stored these in plain text. In production you\u2019ll want to store and retrieve credentials in a secure manner using a service like AWS Secrets Manager.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1489\" src=\"https:\/\/app.works\/wp-content\/uploads\/2018\/05\/Screen-Shot-2018-05-15-at-10.13.22-AM.png\" alt=\"\" width=\"1090\" height=\"1052\" srcset=\"https:\/\/app.works\/wp-content\/uploads\/2018\/05\/Screen-Shot-2018-05-15-at-10.13.22-AM.png 1090w, https:\/\/app.works\/wp-content\/uploads\/2018\/05\/Screen-Shot-2018-05-15-at-10.13.22-AM-600x579.png 600w\" sizes=\"(max-width: 1090px) 100vw, 1090px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The Admin API will be a <\/span><a href=\"https:\/\/community.filemaker.com\/docs\/DOC-8766\"><span style=\"font-weight: 400;\">trial feature<\/span><\/a><span style=\"font-weight: 400;\"> until September 2019. You can provide feedback to FileMaker <\/span><a href=\"http:\/\/www.filemaker.com\/company\/contact\/feature_request.html\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you manage multiple instances of FileMaker Server, maintenance would typically be performed by logging in to each via a web browser or running fmsadmin CLI commands. These methods become unwieldy when you need to make the same change or gather the same bit of information across several servers. A seemingly simple task now takes [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[40,144],"tags":[150,151,152],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>FileMaker 17: Admin API - AppWorks<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/app.works\/filemaker-17-admin-api\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"FileMaker 17: Admin API - AppWorks\" \/>\r\n<meta property=\"og:description\" content=\"If you manage multiple instances of FileMaker Server, maintenance would typically be performed by logging in to each via a web browser or running fmsadmin CLI commands. These methods become unwieldy when you need to make the same change or gather the same bit of information across several servers. A seemingly simple task now takes [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/app.works\/filemaker-17-admin-api\/\" \/>\r\n<meta property=\"og:site_name\" content=\"AppWorks\" \/>\r\n<meta property=\"article:published_time\" content=\"2018-05-15T20:45:36+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2022-08-02T22:26:46+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/app.works\/wp-content\/uploads\/2018\/05\/Screen-Shot-2018-05-15-at-10.13.22-AM.png\" \/>\r\n<meta name=\"author\" content=\"Ian Harris\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ian Harris\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app.works\/filemaker-17-admin-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app.works\/filemaker-17-admin-api\/\"},\"author\":{\"name\":\"Ian Harris\",\"@id\":\"https:\/\/www.app.works\/#\/schema\/person\/3ef640a44e04cd865173748ca9025db9\"},\"headline\":\"FileMaker 17: Admin API\",\"datePublished\":\"2018-05-15T20:45:36+00:00\",\"dateModified\":\"2022-08-02T22:26:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app.works\/filemaker-17-admin-api\/\"},\"wordCount\":417,\"publisher\":{\"@id\":\"https:\/\/www.app.works\/#organization\"},\"keywords\":[\"FileMaker Admin Console\",\"FileMaker API\",\"FileMaker Server Configuration\"],\"articleSection\":[\"Blog\",\"FileMaker 17\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/app.works\/filemaker-17-admin-api\/\",\"url\":\"https:\/\/app.works\/filemaker-17-admin-api\/\",\"name\":\"FileMaker 17: Admin API - AppWorks\",\"isPartOf\":{\"@id\":\"https:\/\/www.app.works\/#website\"},\"datePublished\":\"2018-05-15T20:45:36+00:00\",\"dateModified\":\"2022-08-02T22:26:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/app.works\/filemaker-17-admin-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app.works\/filemaker-17-admin-api\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app.works\/filemaker-17-admin-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.app.works\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FileMaker 17: Admin API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.app.works\/#website\",\"url\":\"https:\/\/www.app.works\/\",\"name\":\"AppWorks\",\"description\":\"Designing Smart Apps Geared to Work for You\",\"publisher\":{\"@id\":\"https:\/\/www.app.works\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.app.works\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.app.works\/#organization\",\"name\":\"AppWorks\",\"url\":\"https:\/\/www.app.works\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.app.works\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/app.works\/wp-content\/uploads\/2021\/02\/cropped-logo-aw-dis-big-1.png\",\"contentUrl\":\"https:\/\/app.works\/wp-content\/uploads\/2021\/02\/cropped-logo-aw-dis-big-1.png\",\"width\":175,\"height\":67,\"caption\":\"AppWorks\"},\"image\":{\"@id\":\"https:\/\/www.app.works\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.app.works\/#\/schema\/person\/3ef640a44e04cd865173748ca9025db9\",\"name\":\"Ian Harris\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.app.works\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a171f6c2eff750a347ccc1ef282ba2a6?s=96&d=identicon&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a171f6c2eff750a347ccc1ef282ba2a6?s=96&d=identicon&r=pg\",\"caption\":\"Ian Harris\"},\"url\":\"https:\/\/app.works\/author\/ianharris\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FileMaker 17: Admin API - AppWorks","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/app.works\/filemaker-17-admin-api\/","og_locale":"en_US","og_type":"article","og_title":"FileMaker 17: Admin API - AppWorks","og_description":"If you manage multiple instances of FileMaker Server, maintenance would typically be performed by logging in to each via a web browser or running fmsadmin CLI commands. These methods become unwieldy when you need to make the same change or gather the same bit of information across several servers. A seemingly simple task now takes [&hellip;]","og_url":"https:\/\/app.works\/filemaker-17-admin-api\/","og_site_name":"AppWorks","article_published_time":"2018-05-15T20:45:36+00:00","article_modified_time":"2022-08-02T22:26:46+00:00","og_image":[{"url":"https:\/\/app.works\/wp-content\/uploads\/2018\/05\/Screen-Shot-2018-05-15-at-10.13.22-AM.png"}],"author":"Ian Harris","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ian Harris","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app.works\/filemaker-17-admin-api\/#article","isPartOf":{"@id":"https:\/\/app.works\/filemaker-17-admin-api\/"},"author":{"name":"Ian Harris","@id":"https:\/\/www.app.works\/#\/schema\/person\/3ef640a44e04cd865173748ca9025db9"},"headline":"FileMaker 17: Admin API","datePublished":"2018-05-15T20:45:36+00:00","dateModified":"2022-08-02T22:26:46+00:00","mainEntityOfPage":{"@id":"https:\/\/app.works\/filemaker-17-admin-api\/"},"wordCount":417,"publisher":{"@id":"https:\/\/www.app.works\/#organization"},"keywords":["FileMaker Admin Console","FileMaker API","FileMaker Server Configuration"],"articleSection":["Blog","FileMaker 17"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/app.works\/filemaker-17-admin-api\/","url":"https:\/\/app.works\/filemaker-17-admin-api\/","name":"FileMaker 17: Admin API - AppWorks","isPartOf":{"@id":"https:\/\/www.app.works\/#website"},"datePublished":"2018-05-15T20:45:36+00:00","dateModified":"2022-08-02T22:26:46+00:00","breadcrumb":{"@id":"https:\/\/app.works\/filemaker-17-admin-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app.works\/filemaker-17-admin-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/app.works\/filemaker-17-admin-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.app.works\/"},{"@type":"ListItem","position":2,"name":"FileMaker 17: Admin API"}]},{"@type":"WebSite","@id":"https:\/\/www.app.works\/#website","url":"https:\/\/www.app.works\/","name":"AppWorks","description":"Designing Smart Apps Geared to Work for You","publisher":{"@id":"https:\/\/www.app.works\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.app.works\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.app.works\/#organization","name":"AppWorks","url":"https:\/\/www.app.works\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.app.works\/#\/schema\/logo\/image\/","url":"https:\/\/app.works\/wp-content\/uploads\/2021\/02\/cropped-logo-aw-dis-big-1.png","contentUrl":"https:\/\/app.works\/wp-content\/uploads\/2021\/02\/cropped-logo-aw-dis-big-1.png","width":175,"height":67,"caption":"AppWorks"},"image":{"@id":"https:\/\/www.app.works\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.app.works\/#\/schema\/person\/3ef640a44e04cd865173748ca9025db9","name":"Ian Harris","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.app.works\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a171f6c2eff750a347ccc1ef282ba2a6?s=96&d=identicon&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a171f6c2eff750a347ccc1ef282ba2a6?s=96&d=identicon&r=pg","caption":"Ian Harris"},"url":"https:\/\/app.works\/author\/ianharris\/"}]}},"_links":{"self":[{"href":"https:\/\/app.works\/wp-json\/wp\/v2\/posts\/1479"}],"collection":[{"href":"https:\/\/app.works\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.works\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.works\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/app.works\/wp-json\/wp\/v2\/comments?post=1479"}],"version-history":[{"count":1,"href":"https:\/\/app.works\/wp-json\/wp\/v2\/posts\/1479\/revisions"}],"predecessor-version":[{"id":10049,"href":"https:\/\/app.works\/wp-json\/wp\/v2\/posts\/1479\/revisions\/10049"}],"wp:attachment":[{"href":"https:\/\/app.works\/wp-json\/wp\/v2\/media?parent=1479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.works\/wp-json\/wp\/v2\/categories?post=1479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.works\/wp-json\/wp\/v2\/tags?post=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}