Build a small CLI for sipgate REST API as part of my very own file system
Go to file
Gandalf 19279eefc3 fax api improved
added options -help and -handle
2021-04-07 18:23:29 +02:00
.gitignore gitignore merged 2021-03-14 11:40:08 +01:00
README.md fax api improved 2021-04-07 18:23:29 +02:00
Testfax.pdf push to remote 2021-03-04 17:51:36 +01:00
authorization.sh apply env.patch 2021-03-13 14:50:48 +01:00
balance.sh Consider absolute paths 2021-03-04 20:17:30 +01:00
fax.sh fax api improved 2021-04-07 18:23:29 +02:00
faxreport.sh Fixed errors in variable handling 2021-03-29 11:47:14 +02:00
getbalance.sh Usability 2021-03-04 19:44:27 +01:00
login_credentials_muster.sh fax api improved 2021-04-07 18:23:29 +02:00
status.sh status.sh did mess up when switching between sipgate accounts. Fixed that 2021-03-11 11:02:39 +01:00

README.md

Sipgate CLI

This is a small hack to send faxes via the sipgate REST API from the command line.

Deployment

Add your login credentials to login_credentials_muster.sh and rename the file to .env If you use Letterheads Address database, uncomment the last line of that file and add your/path/to/Letterhead

Usage

./fax.sh <letter.pdf> <recipient>

sipgate doesn't accept pdf files larger than 30 pages or 10MB.

For now, <recipient> has to be numbers-only, starting with +49. It is planned to parse different number formats. Should be done. Spaces in filename seem to make trouble at the moment - avoid them.

status.sh shows ID, Date and Status of the last ten fax set from this device.

balance.sh just gives your account balance.

faxreport.sh [options] [id] loads the report of a given fax id (as shown by status.sh). If no id ist given, it takes the last fax sent from this machine.

Options:

  • -p to only print and not save the report
  • -d to delete the given id from .fax_history

Recommendation

Put

alias fax="/your/path/to/this/project/fax.sh"
alias faxstatus="/your/path/to/this/project/status.sh"
alias faxbalance="/your/path/to/this/project/balance.sh"
fax-from-handle () { fax $1 "$(/your/path/to/this/project/Letterhead/Adressen/address.sh -f $2)"; }

into your .bashrc or .bash_aliases