Fob
Browse the docs

Output and scripting

Commands follow the pattern fob-zb resource action [id] [options]. Run fob-zb resource to see a resource's actions, or add --help to any command.

Output formats#

You wantUseNotes
A readable table(default)One page of results, with a hint when there are more
Raw JSON of one page--jsonZoho's records as returned, for the current page
Every row as JSON--format jsonFetches all pages, wrapped as {"invoices": […]}
Every row as CSV--format csvFetches all pages. Use it for spreadsheets
Chosen columns--fields a,b,cWorks with table and CSV
Write to a file--output fileData goes to the file. The "Wrote file" notice goes to stderr

--format json and --format csv fetch up to 15,000 rows. If a result is cut off, fob-zb says so on stderr. Narrow it with filters.

Pagination#

Tables and --json return one page: --page (default 1) and --per-page (default and maximum 200).

fob-zb contacts list --page 2 --per-page 50

Filters#

Each list has its own filters. Check --help, for example:

fob-zb invoices list --status overdue --customer 4600xxxxxxx
fob-zb bank-transactions list --account-id 4600xxxxxxx --status uncategorized
fob-zb contacts list --type vendor --search acme

Zoho allows only one of --type and --status on contacts list.

Piping and scripting#

Data goes to stdout and messages go to stderr, so pipes stay clean:

# Total outstanding across overdue invoices
fob-zb invoices list --status overdue --format json \
  | jq '[.invoices[].balance] | add'

# Overdue invoices to a spreadsheet
fob-zb invoices list --status overdue --format csv \
  --fields invoice_number,customer_name,due_date,balance --output overdue.csv

Exit codes#

CodeMeaning
0Success
1Error: an API, credential or validation failure. The message is printed to stderr as Error: …

Set FOB_DEBUG=1 to print stack traces as well.