GSA API endpoint inaccessible

(from github.com/jdeathe)
I’m trying to access the GSA api however it returns a 302 response code. Do I need to enable it via configuration?

[centos@fess fess]$ curl -vI http://localhost:8080/json/?q=fess
* About to connect() to localhost port 8080 (#0)
*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> HEAD /json/?q=fess HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 200
HTTP/1.1 200
< Content-Type: text/javascript+json;charset=UTF-8
Content-Type: text/javascript+json;charset=UTF-8
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Date: Tue, 14 Mar 2017 18:38:54 GMT
Date: Tue, 14 Mar 2017 18:38:54 GMT

<
* Connection #0 to host localhost left intact
[centos@fess fess]$
[centos@fess fess]$ curl -vI http://localhost:8080/gsa/?q=fess
* About to connect() to localhost port 8080 (#0)
*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> HEAD /gsa/?q=fess HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 302
HTTP/1.1 302
< Set-Cookie: JSESSIONID=D3A22F41F52FE2171C54A401348C6891;path=/;HttpOnly
Set-Cookie: JSESSIONID=D3A22F41F52FE2171C54A401348C6891;path=/;HttpOnly
< Location: /error/notfound/?url=%2Fgsa%2F
Location: /error/notfound/?url=%2Fgsa%2F
< Content-Type: text/html;charset=UTF-8
Content-Type: text/html;charset=UTF-8
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Date: Tue, 14 Mar 2017 18:39:10 GMT
Date: Tue, 14 Mar 2017 18:39:10 GMT

<
* Connection #0 to host localhost left intact

(from github.com/marevol)
Try to put the following setting to system.properties:

web.api.gsa=true

(from github.com/jdeathe)
Doesn’t appear to pick up the config @marevol - Am I missing any steps?

sudo bash -c "echo 'web.api.gsa=true' >> /usr/share/fess/app/WEB-INF/conf/system.properties"
sudo systemctl restart fess
[centos@fess fess]$ curl -vI http://localhost:8080/gsa/?q=fess
* About to connect() to localhost port 8080 (#0)
*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> HEAD /gsa/?q=fess HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 302
HTTP/1.1 302
< Set-Cookie: JSESSIONID=EFDBCAAB8B8869A7280C60B03446D2B9;path=/;HttpOnly
Set-Cookie: JSESSIONID=EFDBCAAB8B8869A7280C60B03446D2B9;path=/;HttpOnly
< Location: /error/notfound/?url=%2Fgsa%2F
Location: /error/notfound/?url=%2Fgsa%2F
< Content-Type: text/html;charset=UTF-8
Content-Type: text/html;charset=UTF-8
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Date: Tue, 14 Mar 2017 18:53:35 GMT
Date: Tue, 14 Mar 2017 18:53:35 GMT

(from github.com/marevol)
If you installed RPM/DEB package, system.properites is in /etc/fess.

(from github.com/jdeathe)
@marevol …yes it is! Sorry about that.

This worked:

sudo bash -c "echo 'web.api.gsa=true' >> /etc/fess/system.properties"
sudo systemctl restart fess
curl -I http://localhost:8080/gsa/?q=fess
HTTP/1.1 200
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 14 Mar 2017 19:11:01 GMT

Thanks :slight_smile: