I want to modify a resource via api, The url like this :
and the method is PUT and the request body
"version" : 0,
the response was shown like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><errorDescriptor><errorCode>not.a.file</errorCode><message>Resource /reports/cgd_eva/test_60_1 is not a file</message><parameters><parameter>/reports/cgd_eva/test_60_1</parameter></parameters></errorDescriptor>
What's wrong with this? or a report unit can not be modified.
There could be multi causes but possibly the specific error points to the content-type specified. The body should have the <reportUnit> in the resource descriptor.
Here is a working example where I tried to modify the label of the existing report unit :
If your aim is to simply update specific elements only using 'patch' method, that didn't work for me either nor is this in the REST API guides. Its best to download the existing report resource descriptor, make the change and use the PUT method with content-type as "application/repository.reportUnit+xml" (or application/repository.reportUnit+json if you prefer json format)
For something like this, you need to fiddle around with the resource descriptors a bit to get it right..so a few attempts may be required.