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.

Featured Replies

Hi,

I'm strugeling on my first steps with the API. I've read the documentation and using curl to ensure that the API calls are correct.

bash variables are set and working.

Quote

FROXLOR_API_KEY=as471...
FROXLOR_API_SECRET=kp471...
AUTH=$(echo -ne "$FROXLOR_API_KEY:$FROXLOR_API_SECRET" | base64 --wrap 0)


What works is the readout via API using the example from the documentation:

Quote

curl -v \
  --header "Content-Type: application/json" \
  --header "Authorization: Basic $AUTH" \
  --request POST \
  --data  '{"command":"Froxlor.listFunctions"}' \
  https://domain.tld/api.php

What does not work is the creation of an email address. 

Quote

curl -v \
  --header "Content-Type: application/json" \
  --header "Authorization: Basic $AUTH" \
  --request POST \
  --data  '{"command":"Emails.add","email_part": "test86","domain": "domain.tld"}' https://domain.tld/api.php

[...]

 

 

The API tells me: Requested parameter \"email_part\" could not be found for \"Emails:add\""

What am I doing wrong?

  • Author

Thanks for the quick reply; you're right. Sorry for my dump question but shoulnd this be correct?

 

Quote

curl -v \
  --header "Content-Type: application/json" \
  --header "Authorization: Basic $AUTH" \
  --request POST \
  --data  '{"command": "Emails.add","params":[{"email_part":"test86","domain":"domain.tld"}]}' https://domain.tld/api.php

 

So by your question I guess it's not working? Why waste time for a meta question ... just post the error/response

  • Author

Error is the same. "Requested parameter \"email_part\" could not be found for \"Emails:add\""
 

Your JSON array is wrong, instead of

"params":[{"email_part":"test86","domain":"domain.tld"}]

just use

"params":{"email_part":"test86","domain":"domain.tld"}

Difference (as php would view it):

[
   "command" => "Emails.add", 
   "params" => [
         [
            "email_part" => "test86", 
            "domain" => "domain.tld" 
         ] 
      ]
]

and the correct syntax:

[
   "command" => "Emails.add", 
   "params" => [
            "email_part" => "test86", 
            "domain" => "domain.tld" 
      ]
]

 

  • Author

Okay. Got it, thanks!

Three API calls via curl as further examples from my test run for all readers of the forum

Create eMail

Quote

curl -v \
  --header "Content-Type: application/json" \
  --header "Authorization: Basic $AUTH" \
  --request POST \
  --data  '{"command": "Emails.add","params":{"email_part":"test123","domain":"mydomain.com"}}' https://froxlor.mydomain.com/api.php

Create Forward

Quote

curl -v \
  --header "Content-Type: application/json" \
  --header "Authorization: Basic $AUTH" \
  --request POST \
  --data  '{"command": "EmailForwarders.add","params":{"emailaddr":"test123@mydomain.com","destination":"recipient@mydomain.com"}}' https://froxlor.mydomain.com/api.php

Delete eMail

Quote

curl -v \
  --header "Content-Type: application/json" \
  --header "Authorization: Basic $AUTH" \
  --request POST \
  --data  '{"command": "Emails.delete","params":{"emailaddr":"test123@mydomain.com"}}' https://froxlor.mydomain.com/api.php

BR Christian

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.