1 (edited by rushcoff 2017-06-02 16:11:45)

Topic: The problem with iredadmin api

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 PGSQL edition
- Linux/BSD distribution name and version: Ubuntu 16.04.2 LTS (Xenial Xerus)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello. I installed iredmail on a clean system.
In the settings /opt/www/iRedAdmin-0.7/settings.py pointed ENABLE_RESTFUL_API = True

Then I took the code from the example on the site:
rushcoff@mx:~$ curl -X POST -c cookie.txt -d "username=postmaster@demo.example.com&password=111222" https://mx.example.com/iredadmin/api/login

In response, the command line displays:
not foundrushcoff@mx:~$

but the cookie file is created:
--------------------------------------
# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_mx.example.com    FALSE    /iredadmin/    FALSE    0    iRedAdmin    90fbe0f4ff18973e4a8a73e76084dff3034d85d7
----------------------------------------------------------------------------------------------------------------

Then I try to create a new domain test2:

curl -X POST -i -b cookie.txt -d "cn&quota=20480" https://mx.example.com/iredadmin/api/domain/test2.com

A message is displayed in response:
----------------------------------------------------
HTTP/1.1 404 Not Found
Server: nginx
Date: Fri, 02 Jun 2017 07:59:13 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: iRedAdmin=a72eee96e12cba0cbb288d2ca1ed374d0b61355d; Path=/iredadmin/; httponly
---------------------------------------------------------------------------------

Please, help me!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: The problem with iredadmin api

IRedAdmin open source edition doesn't offer RESTful API, please consider buy iRedAdmin-Pro if you need API:
http://www.iredmail.org/admin_panel.html