cancel
Showing results for 
Search instead for 
Did you mean: 

adding data source i.e universe to newly created report document using rest api

Former Member
0 Kudos

I have created report document using rest api and it got created successfully.

(post url to create document : http://{0}:6405/biprws/raylight/v1/documents

Xml to post : <document><name>Some unique report name</name><folderId>13025</folderId></document>)

 

My requirement is,  When we open new report, we do not need to select universe again.

We try to use data provider api to add data source like below :

api to call : http://[server ip]:6405/biprws/raylight/v1/documents/15698/dataproviders

post xml format : <dataprovider><name>[i put universe name here]</name><dataSourceId>[i put here universe id]</dataSourceId></dataprovider>

After calling api to add data provider, got its result like

The resource of type "Data provider" with identifier "DP0" has been successfully created.

But when I open report , I always need to choose universe(even I have only 1 universe).

I do not want user to choose universe as it already set in data provider.

I want user only needs to add query.

Please let me know if any information.

Thanks in Advance.

Samir

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197386
Active Contributor
0 Kudos

Hi Samir,

Did you send a RESTful call to save the modified document to CMS after adding a new dataprovider?

Regards,

Anthony

Former Member
0 Kudos

Hi

Trying to call 'Saving a Document' Api POST/documents/<documentID>.

Thanks

Samir

Former Member
0 Kudos

Hi Anthony,

Fyi , I am getting error (internal server error). Investing what could be proper work-flow.

Below is my steps :

1st : Creating new report document using API.

2nd : Call data provider API to add universe Data source.

3rd : Calling above api to saving a document.

Thanks

Samir

Former Member
0 Kudos

I have used -1 as folder id , still not working.

daniel_paulsen
Active Contributor
0 Kudos

I'm not sure, but it could be that its trying to save a document with the same name to the same folder.

something else to try (instead of POST  /documents/<docId> ) is to save and close the document using:

PUT  /documents/<docId>

body:

          <document>

               <state>Unused</state>

          </document>

this should save and close the document and you can verify if it has the dataprovider added by requesting a list of dataproviders

GET     ../documents/<docId>/dataproviders

this second call is just a test to verify it worked since it will need to re-open the document.

Dan