OttoFMS Admin API help

I’m trying to use the OttoFMS Admin API to restart the wpe processes on the server. I have created and Admin API key in OttoFMS and have successfully tested that key by calling the https://{FMS Name Here}/otto/api/info endpoint.

When I POST to https://{FMS Name Here}/otto/api/fms-process endpoint with the following body:

{“command”:“restart”,“service”:“wpe”}

and the following cURL:

-X POST -H “Content-Type: application/json” -H “Accept: application/json” -u “Authorization: Bearer {apiKey Here}”

I get the following response:

“Unable to validate credentials: Local Admin API error: Fetch failed: Unauthorized code: 1703 - Invalid username or password, or JSON Web Token; Path: /fmi/admin/api/v2/user/auth”

I’ve tried a bunch of things and have read through the OttoFMS Developer API docs and am stuck.

Can anyone offer some assistance here? What am I missing?

P.S. I did NOT create a FileMaker Admin API Public Key in the Filemaker Server Admin. Is that what I’m missing?

Hey Matt,

The Authentication header needs to be passed as a header and not as a user field. changing you “-u” to a “-H” should fix your problem. Thank you!!

Passing it as a user field attempts to use what you’ve entered to do basic auth.

-Kyle

Thank you, Kyle!!

I had a feeling it was a syntax issue.

-Matt

1 Like