REST API: Edit Job Issues

0

Hi Guys,

I'm following documentation to modify Report Schedule (Job): http://community.jaspersoft.com/documentation/tibco-jasperreports-server...

The goal is to modify mailNotification subModel, but even with simple update I encounter issues.

Jasper Reports Server version: 6.3.0

POST /jasperserver/rest_v2/jobs/11056/ HTTP/1.1
Host: jasper-server.example.com:10080
Authorization: Basic <token>
Accept: application/job+json
Content-Type: application/job+json
Cache-Control: no-cache
{  
  "label": "Modified Label"
}

I've tried providing a full Job descriptor and minimal descriptor, but response is still the same.

It's HTML login page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>TIBCO Jaspersoft: Login</title>
...

Also log file indicates CSRF error:

2017-01-23 10:19:17,166 ERROR CsrfGuard,http-apr-0:0:0:0:0:0:0:0-10080-exec-12:44 - potential cross-site request forgery (CSRF) attack thwarted (user:<anonymous>, ip:<ipaddress>, method:POST, uri:/jasperserver/rest_v2/jobs/11056/, error:required token is missing from the request)

Also to mention, other GET requests work perfectly fine.

mr.tonic's picture
Joined: Jun 26 2016 - 4:53am
Last seen: 1 year 1 month ago

Hi 

 

I see the same error in my logs, but when I add X-REMOTE-DOMAIN to my POSTMAN put request, I still get this error:

 

HTTP Status 401 - Domain 1 forbidden.


type Status report

message Domain 1 forbidden.

description This request requires HTTP authentication.


Apache Tomcat/7.0.32

 

any idea?

 

regards

krikke_wl - 1 year 7 months ago

1 Answer:

0

If anyone has the same issue.

http://community.jaspersoft.com/documentation/tibco-jasperreports-server...

To allow testing of the REST API through a browser, configure your browser REST client to include the following header in every request:

X-REMOTE-DOMAIN: 1

 

mr.tonic's picture
Joined: Jun 26 2016 - 4:53am
Last seen: 1 year 1 month ago
Feedback