Hi,
Could you please explain, how does it work?
curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/Lab%201.unl
I have these outputs:
root@eveng:~# curl -s -b /tmp/cookie -c /tmp/cookie -X POST -d '{"username":"User1","password":"testpassword1"}' http://127.0.0.1/api/auth/login
{"code":200,"status":"success","message":"User logged in (90013)."}
root@eveng:~#
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/auth
{"code":200,"status":"success","message":"User has been loaded (90002).","data":{"email":"v@hotmail.com","folder":"\/Shared","lab":null,"lang":"en","name":"","role":"admin","tenant":"1","html5":"1","username":"User1"}}
root@eveng-isr:~#
I have my test here:
Current position / root / Shared / test.unl
When I try to load my test I receive this message
root@eveng:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":404,"status":"fail","message":"Lab does not exist (60000)."}root@eveng:~#
What is my mistake?
Open any LAB by API
Moderator: mike
-
- Posts: 3
- Joined: Mon Jul 06, 2020 5:12 am
Re: Open any LAB by API
Ok,
no problem
The test should be moved from the folder "Current position /root/Shared" to the folder "Current position /root/User1"
root@evengr:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":200,"status":"success","message":"Lab has been loaded (60020).","data":{"author":"User1","description":"","body":"","filename":"test.unl","id":"732c2ba5-725c-4976-8e79-c2655cd134bc","name":"test","version":"1","scripttimeout":300,"lock":0}}root@eveng:~#
root@eveng:~#
no problem
The test should be moved from the folder "Current position /root/Shared" to the folder "Current position /root/User1"
root@evengr:~# curl -s -c /tmp/cookie -b /tmp/cookie -X GET -H 'Content-type: application/json' http://127.0.0.1/api/labs/User1/test.unl
{"code":200,"status":"success","message":"Lab has been loaded (60020).","data":{"author":"User1","description":"","body":"","filename":"test.unl","id":"732c2ba5-725c-4976-8e79-c2655cd134bc","name":"test","version":"1","scripttimeout":300,"lock":0}}root@eveng:~#
root@eveng:~#