Unable to download project report using REST API
I am seeing 502 error when I am trying to download the project report using REST API.
I tried to isolate the cases for which this might be happening, and narrowed to 2 particular requests, that are throwing the 502 error.
Response Error :
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title>502 Proxy Error</title>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request
<em><a href="/codeinsight/api/project/generateReport">GET /codeinsight/api/project/generateReport</a></em>.
Reason: <strong>Error reading from remote server</strong></p>
- When I try to login into the portal and download the reports for the above mentioned projectId, they get downloaded successfully.
- These reports are slightly larger in size (4.69Mb). And there might be a timeout set on the Http GET request, which is preventing these reports from getting downloaded.
I believe the Analyzer you are referring to is the legacy Analyzer available in Code Insight v6. In Code Insight v7, the legacy Analyzer has been replaced by CodeAware, which is basically the “next generation” analyzer, and provides much of the same analysis functionality as the legacy Analyzer. The legacy Analyzer is not available in v7, so you will not be able to enable it.
We have just initiated to install the 2023R2 version as you had recommended in your past comments. Would this version have the "CodeAware" ? If yes, do we need to enable it, or does it come built in? Can you share any documentation/API reference on how we can use it?
@tphamda . Thanks so much for your inputs. Basically, I wanted to understand a few things. Currently this is what I do:
+ I have a few "Advanced Search" criteria that I have already added.
+ I create an inventory say "Inventory A"
+ I run one advanced search criteria, and whatever files get listed there, I right click - > "Add to Inventory" (Inventory A) - PFA a snapshot
+ This is how I am doing manual auditing.
Do you have any inputs as to how I can automate this process using REST API? I think I get the creating inventory part. But How do I list the files from Advanced search and add to inventory using API?
Additionally, Is there a better recommendation you might have of doing a manual Audit?
Appreciate your input.
@rhiremath, using the REST API to get results similar to the Advanced File Search will be more involved. For example, you can first get all scanned files with:
This will return some details including the file ID, whether the file ha been reviewed, if it contains evidence, etc. If you need further file details to filter, you can get more file details from the file ID by calling:
To add a file to inventory, you can use:
Regarding auditing recommendations, I can at least point you to our documentation which goes over general usage:
We also have some videos that cover core concepts here (you will need to be logged in first):
If you need further hands-on assistance, I would recommend contacting either your Customer Success Manager (CSM) or our Services team, who can provide help on custom scripting and training per your specific requirements. Please note that a Services engagement would incur a cost. Please let us know if you had any questions on this.
Hi @tphamda ,
Our IT team helped us to setup a test evaluation server with the version 2023 R2 like you had recommended.
However, we are not able to use the APIs. Is there any special access that needs to be enabled so that we can access APIs on the new server?
Can you confirm if you are on 2023 R2 or our latest version, 2023 R3? The reason I ask is that we have recently discovered an issue with the Download Report API failing with custom reports on 2023 R3 where the following message is returned:
The taskId entered is not mapped to the project or report. Please check and try again.
If you are not on 2023 R3, can you please provide what response you are seeing when running the API calls?
I would also recommend trying the API calls with SWAGGER UI. You can access it in the Web UI by going to the Menu > Help page and clicking on the 'REST API Guide' hyperlink. Here you can click "Try it out" and input the required values. Note that for Authorization, you will need to include Bearer as part of the field value. e.g. Bearer <JWT_TOKEN>.