Jump to content
View in the app

A better way to browse. Learn more.

Froxlor Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to use froxlor-cli for api-calls / how to provide parameters?

Featured Replies

Can someone please tell me how to use the froxlor-cli for api-calls e.g. to add a customer?

I tried the following and several other ways to provide the parameters but it doesn't seem to work.

bin/froxlor-cli froxlor:api-call -s froxlor Customers.add  '{"email": "mail@example.com", "company": "example-inc", "new_loginname": "example"}'

Thanks in advance!

Solved by d00p

Go to solution
  • nebulo changed the title to How to use froxlor-cli for api-calls / how to provide parameters?

`-s` = show parameters, that won't run the `Customers.add` API call.

The commands call is the following:

froxlor:api-call [options] [--] <user> <api-command> [<parameters>]

Also:

Arguments:
  user                  Loginname of the user you want to run the command as
  api-command           The command to execute in the form "Module.function"
  parameters            Paramaters to pass to the command as JSON array

The API doc for adding customers can be found here: https://docs.froxlor.org/latest/api-guide/commands/customers.html#customers-add

  • Author

Thanks for the amazing fast feedback!

Of course the '-s' is a mistake but I struggeled with how to provide the parameters in the array.

Just for documentation: The following works.

Quote

froxlor-cli froxlor:api-call froxlor Customers.add '{"email": "info@example.com", "company": "example inc", "new_loginname": "example"}'

 

  • Solution
Just now, nebulo said:

am struggling with how to provide the parameters in the array.

As stated in the --help output of the command:
 

parameters            Paramaters to pass to the command as JSON array

Dont see where you are doing anything wrong, looks ok to me (and you've stated that the following works...)

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.