0

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>
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
NL3294
  • 984
  • 1
  • 10
  • 27

1 Answers1

1

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.

Arnaud Develay
  • 3,920
  • 2
  • 15
  • 27
  • I guess I'm confused as to the difference between a document versus a report. (i'm not really a poweruser). After logging into the management console, I just click on "Folders", then navigate down to the report that I want. Is the containing folder the "document"? I know, if I r-click->properties on the report, it shows my the "ID, CUID", but I have no idea what the "document" is. Can you elaborate, or point me in the right direction to learn more? I tried googling it, but I can't see to find any explanation. – NL3294 Jul 13 '19 at 00:00
  • The document is what you call a report. Each Web Intelligence document can have several 'tabs' which are called reports. – Arnaud Develay Jul 13 '19 at 07:18
  • When I hit: /biprws/raylight/v1/documents/746001, it gives me an error: The resource of type 'Document' with identifier '746001' does not exist. I am able to navigate to the report in CMC, then rclick->properties. It shows "ID, CUID:746001, AdgNq_GsaqhOqnzc4gRN_Jg" That means 746001 is the documentID doesn't it? Or am I still not understanding? – NL3294 Jul 24 '19 at 19:44
  • Yes, it is the good document identifier. Are you sure that you are querying the same CMS in both cases ? (perhaps you have on prod environment and on test environment, in this case document id are not the same) – Arnaud Develay Jul 25 '19 at 12:47
  • Thanks. Yes, I think I'm on the same CMS. I found that I'm on an older version of BOE than what the documentation says, so i think i'll need to see if it works after I do the updates. I'm showing that I'm still on Support Pack 2. I'm guessing that's probably the problem, but I'll need to see when I can run updates without affecting other users on our system. Thanks for all your help. – NL3294 Jul 29 '19 at 23:58