FileMaker Admin API Authentication Issue

Now that the FileMaker Admin API is a standard feature in FileMaker Cloud for AWS 1.18 and FileMaker Server 18 and no longer a trial* I’ve been incorporating certain parts of the Admin API into client solutions. For example it is often helpful to see how many users are logged into your solution and get a list of their Account Names without having to use the Admin Console, or provide non admin users with access to the Admin Console.

I recently encountered an issue when calling the List Clients endpoint to see who was currently connected to a particular FileMaker solution. It was generating a 1627 error (Authentication failed) when performing the Insert from URL script step. This was strange as the same script had been working successfully earlier in the day and in previous days. I double checked the credentials for the server that were being used in the API request and they were correct, and verified these by logging into the Admin Console.

I was a bit puzzled at this stage and ran through the script once more with the Script Debugger. I was saving the response from the Insert from URL script step into a local variable, and upon further examination I noticed this was recording the following response from the Admin API:

{
"response": {},
"messages": [
{
"code": "956",
"text": "Maximum number of Admin API sessions exceeded"
}
]
}

There were no other Admin API sessions in use at this point – the Admin Console wasn’t being used – which further confused things. Logging in to the Admin Console again I could see that the list of connected clients wasn’t correct. If you’ve been using the FileMaker Server Admin Console for a few years now you’re probably familiar with this situation and the need to periodically restart the Admin Server via the following command line interface command:

fmsadmin restart adminserver

Once the Admin Server had restarted I tried the Admin API request to list the currently connected clients and it was successfully this time, so the authentication error was misleading in this case. If you encounter this error and you’ve verified the credentials are correct I would just go and restart the Admin Server on the FileMaker Server using the command line option above.

* the FileMaker Admin API was a trial feature in FileMaker Cloud 1.17 and FileMaker Server 17 and that trial period will expire on September 27, 2019 after which the API will cease to operate