REST API 4 on phpList 3.6.7

Followed the instructions, I can`t get API work.
Testion it with Postman this is the error:

imagen

imagen

Any idea of what is happening ?

@Alejo “V2” in the URL should be lower case.

Thanks a lot ! I`ll try on monday. Happy weekend !

Still same problem:

@Alejo Your command works for me

curl --request POST --url http://192.168.1.4/lists/api/v2/sessions --header 'Content-Type: application/json' --data '{"login_name": "aaa","password": "bbb"}'
{"code":401,"message":"Unauthorized"}

Maybe phplist isn’t installed where you think it is. Also mod_rewrite is required to use /api/v2/sessions
You can try using /api.php/sessions instead.

it may be a misunderstanding by me. (Sorry not my native lang).
is it a prerequisite to install phplist 4 before trying to run the api in phplist 3 ?

@Alejo phplist includes the necessary parts of phplist 4 and the API in the base directory. In your screenshot, the current directory is within that, so it is there.

Is this the correct IP address, does 168 really appear twice? 192.168.168.45

Thanks again.Yes, that´s my ip address.
I have some “newbbie” questions:
1.- Any requirements about user and group of list directory ? (chown and chgrp)
2.- Enabling logs for the API: where are they?

Reinstalled all list directory, now the error changed. Each time I call the api in POSTman, the answer is Error 500:

FYI: New address for server 192.168.168.230

@Alejo Have you made the change to enable the API described here API and integrations | phpList manual

@duncanc Yes, I followed all the steps but installig phplist3 manually (copying list directory to my web server)

@Alejo Are you using php 8? I had to revert to php 7.4 to get the API to work on my web site.

Try accessing https://www.dcameron.me.uk/lists/api/v2/sessions using any login name and password.

Tested again in a bitnami phplist machine. Same happens. With wrong credentials seems it is working, but with good ones I get “Internal server error”

The user “user” is a Superadmin
php version 7.4.28

@duncanc Hello again: Environment variables are necessary ? Have you any step by step guide, other than API and integrations | phpList manual ?

Any php module not present and needed ?

@duncanc Now It’s working !!! Just installing php additional modules.

With theese installed works. Not knowing what of them are really requested

php-bz2/focal,now 2:7.4+75 all [instalado, automático]
php-common/focal,now 2:75 all [instalado, automático]
php-curl/focal,now 2:7.4+75 all [instalado, automático]
php-google-recaptcha/focal,now 1.2.3-1 all [instalado, automático]
php-mysql/focal,now 2:7.4+75 all [instalado, automático]
php-net-socket/focal,now 1.0.14-2 all [instalado]
php-phpmyadmin-motranslator/focal,now 5.0.0-1 all [instalado, automático]
php-phpmyadmin-shapefile/focal,now 2.1-3 all [instalado, automático]
php-phpmyadmin-sql-parser/focal,now 4.6.1-2 all [instalado, automático]
php-phpseclib/focal,now 2.0.23-2 all [instalado, automático]
php-psr-cache/focal,now 1.0.1-2 all [instalado, automático]
php-psr-container/focal,now 1.0.0-2 all [instalado, automático]
php-psr-log/focal,now 1.1.2-1 all [instalado, automático]
php-symfony-cache-contracts/focal,now 1.1.8-1 all [instalado, automático]
php-symfony-cache/focal,now 4.3.8+dfsg-1ubuntu1 all [instalado, automático]
php-symfony-expression-language/focal,now 4.3.8+dfsg-1ubuntu1 all [instalado, automático]
php-symfony-service-contracts/focal,now 1.1.8-1 all [instalado, automático]
php-symfony-var-exporter/focal,now 4.3.8+dfsg-1ubuntu1 all [instalado, automático]
php-tcpdf/focal,now 6.3.5+dfsg1-1 all [instalado, automático]
php-twig-extensions/focal,now 1.5.4-1 all [instalado, automático]
php-twig/focal,now 2.12.5-1 all [instalado, automático]
php-zip/focal,now 2:7.4+75 all [instalado, automático]
php7.4-bcmath/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-bz2/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado, automático]
php7.4-cli/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-common/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-curl/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado, automático]
php7.4-gd/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-json/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-mbstring/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-mysql/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-opcache/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado, automático]
php7.4-readline/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado, automático]
php7.4-xml/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado]
php7.4-zip/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 amd64 [instalado, automático]
php7.4/focal-updates,focal-security,now 7.4.3-4ubuntu2.10 all [instalado]
phpmyadmin/focal,now 4:4.9.5+dfsg1-2 all [instalado]

@Alejo Thanks for explaining that.