Forum Discussion

bwuerkner's avatar
bwuerkner
New Member
5 years ago

getReviewFile throwing null pointer exception

Hi everybody,

 

I'm having troubles retrieving files from reviews via the JSON api. 

Technically I only want to retrieve the names of the files but none of the attempts I've made succeeded.

My request looks as follows (using the v1 testing form) using version collaborator 12.2.12203

 

[ {
  "command" : "SessionService.setMetadata",
  "args" : {
    "clientName" : "HTML JSON API Tester",
    "expectedServerVersion" : "12.2.12203"
  }
}, {
  "command" : "ServerInfoService.getVersion"
}, 
{
  "command": "SessionService.authenticate",
  "args":{
    "login":"<name>",
    "ticket":"<token>"
  }
},
{
  "command" : "Examples.checkLoggedIn"
},
{
  "command": "ReviewService.getReviewFile",
  "args":{
    "versionId":123456,
    "reviewId":1234
  }
}
]

 

Every other command, such as getComments or findReviewsByCustomFieldValue works for me without troubles but the output of the above is:

 

[ {
  "result" : { }
}, {
  "result" : {
    "version" : "12.2.12203"
  }
}, {
  "result" : { }
}, {
  "result" : {
    "loggedIn" : true
  }
}, {
  "errors" : [ {
    "code" : "NullPointerException",
    "message" : null
  } ]
} ]

 

The fact that it throws a null pointer exception tells me that there's something wrong with the server and not my code. 

Does anybody else have this problem or do I have to bug my IT team to update the version we're using?

 

Cheers,

  Ben

  • aqAnt's avatar
    aqAnt
    SmartBear Alumni (Retired)

    Hi Ben,

     

    The error occurs because your ReviewService.getReviewFile method call lacks of two required parameters. Please modify the method call like this to make it works:

    {
    "command" : "ReviewService.getReviewFile",
    "args" : {
      "versionId" : 123456,
      "reviewId" : 1234,
      "clientBuild" : 12203,
      "active" : true
    }}