1

Topic: RESTful API is not working

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Red Hat 4.8.5-4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Maildir
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro?Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi,
i tried to use/activiate the API, I did excatly whats written in the manual for it (https://docs.iredmail.org/iredadmin-pro.restful.api-20170123.html#enable-restful-api; I added the line to the config and restarted apache) but when I try to acces the API in any way I get the message "not found"

curl -X POST -c cookie.txt -d "username=<user>&password=<password>" https://<public server ip>/iredadmin/api/login
not found

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

#HttpOnly_<public IP from server>    FALSE   /iredadmin/     FALSE   0       iRedAdmin-Pro-mysql     aa3d849244d5959bb5b2a9d4dfd417aa8d53727f

Any ideas?

P.S.: the <fields> I replaced while posting this for data security, they are correct

----

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

2

Re: RESTful API is not working

Atlas wrote:

https://<public server ip>/iredadmin/api/login

Can you access iRedAdmin-Pro with url https://<public server ip>/iredadmin/?

Please show us the lines you added in iRedAdmin-Pro config file to enable API.

3

Re: RESTful API is not working

The iRedAdmin-Pro Panel is accessable like normal.
These are the lines I added:

##################################################
#API Settings
# Enable restriction
RESTRICT_API_ACCESS = True


ZhangHuangbin wrote:
Atlas wrote:

https://<public server ip>/iredadmin/api/login

Can you access iRedAdmin-Pro with url https://<public server ip>/iredadmin/?

Please show us the lines you added in iRedAdmin-Pro config file to enable API.

4

Re: RESTful API is not working

Atlas wrote:

# Enable restriction
RESTRICT_API_ACCESS = True

this parameter is used for restrict api access.

Do you have this line to ENABLE the API?

ENABLE_RESTFUL_API = True