Skip to content

CLI, Automatization and Cronjobs

Dmitriy Novash edited this page Dec 15, 2020 · 2 revisions

You can use the IFM API to automatically download or upload files, e.g. with curl:

$ curl "https://ifmdemo.misterunknown.de/ifm.php" -X POST -F "api=upload" -F "dir=" -F "file=@path/to/local/file"
{"status":"OK","message":"File successfully uploaded.","cd":""}

At the moment there is no complete API specification available, so you have to read the code to perform such calls, or just write me an email.

autorization

If you want to use the API with curl and want to use authentication, you can do this by passing the X-IFM-AUTH header. This header is constructed like the widely known basic authorization header. Just join username and password with a colon and do a base64 encode:

$ echo -en "username:password" | base64
dXNlcm5hbWU6cGFzc3dvcmQ=
$ curl -H "X-IFM-Auth: dXNlcm5hbWU6cGFzc3dvcmQ=" ...