restful-urlbusiness-objects

How do I get the documentID in Business Objects Restful API?


I'm trying to figure out how to download a PDF from the BOE restful API.

I've been following the answer from ƘɌỈSƬƠƑ here: SAP BI Open Doc URL for retrieving pdf

I was able to accomplish step 1 (getting the token).

But on the second step, it mentions using the documentID.

e.g.

/biprws/raylight/v1/documents/5690743/parameters

On the front end of BOE, if I click on the report, and choose Properties, it shows me that the "ID/CUID" is:

ID, CUID:746001, AdgNq_GsaqhOqnzc4gRN_Jg

Does that mean the "DocumentID" is 746001?

I'm not sure if I'm using the correct ID, because when I hit:

/biprws/raylight/v1/documents/746001/parameters

I get:

<error>
   <error_code>100</error_code>
   <message>Rule not respected (Argument 'reportIds' must not be null)</message>
</error>

Solution

  • You don't need to obtain prompt information (/parameters endpoint).

    I think you are using the correct ID since the error is on the report. You obtain a 404 Not Found response status, if the document does not exist.

    After a successful login, simply call /biprws/raylight/v1/documents/5690743 and add to your request an header with name Accept and value application/pdf. Of course the X-SAP-LogonToken should also be provided.

    It will export the whole document. If you only need a specific report, you need to retrieve its ID first. Call the URI /biprws/raylight/v1/documents/5690743/reports with Accept header equals to application/json.

    Choose one of the report, and get its ID (for example, in my case reportID equals 1234). Then you can export the report as a PDF by calling the URI: /biprws/raylight/v1/documents/5690743/reports/1234 with Accept header equals to application/pdf.