Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 12, 2016 at 09:41 AM

    Hi Samir,

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

    Regards,

    Anthony

    Add comment
    10|10000 characters needed characters exceeded

    • 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