Testlink rest api through the postman 404 error

Keywords: TestLink - Windows - Technical issue - Connectivity (SSH/FTP)
Description:
I installed testlink 1.9.20-6. The web application works fine and I can create a test project.
I’m trying to call the REST API through the Postman by the below URLs, but all getting back 404 errors. I set the “APIKEY” in the header as well. Could you please help me?

http://192.168.5.139/testlink/lib/api/rest/v1/whoAmI13
http://192.168.5.139/testlink/lib/api/rest/v2/whoAmI2
http://192.168.5.139/testlink/lib/api/rest/v3/whoAmI1
Followed this :
Install bitnami.
Install slim via composer
Enable API (in C:\Bitnami\testlink-1.9.20-6\apps\testlink\htdocs\config.inc.php => $tlCfg->api->enabled = TRUE;)
Enable Automation test (in C:\Bitnami\testlink-1.9.20-6\apps\testlink\htdocs\config.inc.php => $tlCfg->exec_cfg->enable_test_automation = ENABLED;)
Generate API Key
Create a test project

and When I call “http://127.0.0.1/testlink/lib/api/xmlrpc/v1/xmlrpc.php”, I got 200 (OK) but for http://127.0.0.1/testlink/lib/api/rest/v2/testprojects getting 404 error

Thanks

Hi @anusha.k,

Thanks, a user already reported this issue before:

I will ping the engineering team to prioritise fixing it. In the meantime I suggest using a TestLink VM instead.

Best regards,
Michiel

Hi,

I’m afraid the task is still in our backlog. We will update the thread as soon as we have a fix for Windows. In the meantime, would the Linux VM work for your case?

Hi
Thanks for the reply @michiel and @jsalmeron
@jsalmeron I didn’t use Linux VM

Regards,
Anusha.K

Hi,

I had installed TestLink VM and I want to configure email and I want to generate API key
for email - Where do I get the “custom_config.inc.php” file ??
for API key generation - Settings page is blank
Can anyone please help me on this

Hi @anusha.k

How did you deploy the VM? Are you using an hypervisor such as VMware or VBOX in your Windows computer?
If so, you should access Testlink through the IP assigned to your VM, see:

To access the config file (or any other file inside the VM), you need to access the VM via SSH, find more info at:

Best regards,

Juan Ariza

Hi

Thanks for the reply, I have used VBOX and I could get the config file by using commands.
In Test link getting Settings page as blank

Hi @anusha.k

What changes did you introduce in the configuration file?

Could you access your VM and check the logs files below? Just in case you can find some errors/warnings in these logs that gives us a hint about what’s going on.

$ cat /opt/bitnami/apache2/logs/error_log
$ cat /opt/bitnami/testlink/logs/userlog0.log 
$ cat /opt/bitnami/testlink/logs/userlog1.log 

If you’re not sure about how to interpret these logs, please run the bnsupport tool as explained in the next link:

Please note that you need to paste the code ID that is shown at the end, so we can analyze the logs.

Best regards,

Juan Ariza

Hi @jariza

I got error , when I run this cmd - cat /opt/bitnami/apache2/logs/error_log

for this cmd - cat /opt/bitnami/testlink/logs/userlog0.log

for this cmd - cat /opt/bitnami/testlink/logs/userlog1.log

Hi @anusha.k

As you can see in the logs, it’s throwing a PHP error:

PHP Fatal error: Uncaught Error: Call to a member function hasRight() on null in /opt/bitnami/testlink/lib/functions/common.php:1925
Stack trace:
#0 /opt/bitnami/testlink/lib/common.php(1643): getGrantSetWithExit(Object(database), Object(stdClass), Object(testproject), Array)
#1 /opt/bitnami/testlink/lib/userInfo.php(22): initUserEnv(Object(database), Object(stdClass))
#2 {main}
thrown in /opt/bitnami/testlink/lib/functions/common.ph on line 1925

You mentioned you edited the configuration file, could you please let us know what changes did you introduce? Did you modify any other file?

Best regards,

Juan Ariza

Hello, I’m new in this forum and I don’t know if I can expose my issue here. Well, could you please help me, I have almost the same scenario that anusha.k. I installed testlink and it works pretty well, but now I need to connect testlink through the API REST and I’m getting and Authentication Error when I call the endpoint:
http://localhost:8080/testlink/lib/api/rest/v3/testprojects, I received an Ok status(200) but the body response is Authentication Error. I already search documentation at testlink.org (forum, code on github, etc) but I don’t know why it doesn’t connect how it supposed to be. I had try, with the basic auth pasing the APIKEY that generate testlink and also the method of authorization API Key that has postman.

Thank you, ill be waiting for your response

I forget to comment that i’m working with Ubuntu O.S

Hi @alejo5123

Could you please take a look to the thread below?

There you can find some instructions @davidg shared to enabled the Testlink API.

Best regards,

Juan Ariza