Jump to content

REST API: Edit Job Issues


mr.tonic
Go to solution Solved by mr.tonic,

Recommended Posts

Hi Guys,

I'm following documentation to modify Report Schedule (Job): http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v630/jobs-service#Editing_a_Job_Definition

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.1Host: jasper-server.example.com:10080Authorization: Basic <token>Accept: application/job+jsonContent-Type: application/job+jsonCache-Control: no-cache{    "label": "Modified Label"}[/code]

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>...[/code]

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)[/code]

Also to mention, other GET requests work perfectly fine.

 

Link to comment
Share on other sites

  • 1 month later...
  • Solution

If anyone has the same issue.

http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v630/rest-api-overview#Sending_REST_Requests_from_a_Browser

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

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

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

Link to comment
Share on other sites

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...