API in KIMAI2 respond with 302

If i try to call the API over curl for KIMAI2 i only get an error message that the page is not found. In the browser the page is there but i am unable to auth.

curl -X GET -H “accept: application/json” -H “X-AUTH-USER: XXX” -H “X-AUTH-TOKEN: XXX” https://XXX.XXX.de/api/ping -k


<head><title>302 Found</title><script type="text/javascript" src="/ynh_portal.js"></script><link type="text/css" rel="stylesheet" href="/ynh_overlay.css"></link><script type="text/javascript" src="/ynhtheme/custom_portal.js"></script><link type="text/css" rel="stylesheet" href="/ynhtheme/custom_overlay.css"></link></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>

It is found, it says “302 Found:stuck_out_tongue_winking_eye:

What happens is that there’s a redirect (it’s in fact curious that’s 302 is called ‘Found’ … but see 301 Moved permanently for a similar thing)

You should tell curl to follow redirects by adding option -L

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.