Skip to Content

Rstful Webservice create Query based on Universe inJSON

Hello,

i try to create a new query with the REST API.

The SAP documentation give my one example in XML but not in JSON. https://help.sap.com/viewer/58f583a7643e48cf944cf554eb961f5b/4.2.4/en-US/ec55543d6fdb101497906a7cb0e91070.html

I tried to translate it in JSON

{ "query":

{ "dataSourceType": "unx",

"dataSourceId": "5808",

"querySpecification version": "1.0",

"queryData":

{ "resultObjects":

{ "resultObject":

{ "path": "Customer|folder\Geography|folder\City|dimension",

"id": "_IBo8L7IhEeCk0Ylv-tlF2Q" }

} } } }

But i dont find the righ methode :-(.

Does a document exist describing this?

Thank you in advance

Regards Christophe

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    Posted on Feb 27, 2018 at 03:19 PM

    Hi Christophe,

    the json format is described in the following page of the documentation:

    https://help.sap.com/viewer/58f583a7643e48cf944cf554eb961f5b/4.2.4/en-US/45f99c666e041014910aba7db0e91070.html?q=json

    For the XML provided in the sample, the equivalent json would be

    {
        "query": {
            "@dataSourceId": 5808,
            "@dataSourceType": "unx",
            "id": "5664484753352266247",
            "querySpecification": {
                "@version": "1.0",
                "queryData": {
                    "resultObjects": {
                        "resultObject": [
                            {
                                "@id": "_IBo8L7IhEeCk0Ylv-tlF2Q",
                                "@path": "Customer|folder\\Geography|folder\\City|dimension"
                            },
                            {
                                "@id": "_IBo8OrIhEeCk0Ylv-tlF2Q",
                                "@path": "Customer|folder\\Customer|dimension"
                            },
                            {
                                "@id": "_IB8eFrIhEeCk0Ylv-tlF2Q",
                                "@path": "Inventory|folder\\Stock Level|measure"
                            }
                        ]
                    }
                }
            }
        }
    }
    

    For the above, I just created a query with the XML sample and then retrieved it using application/json in the Accept header.

    Dan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2018 at 02:59 PM

    SAP API Business Hub:

    https://api.sap.com/shell/discover/contentpackage/WebIntelligenceRESTfulAPI

    This provides all required info about the APIs.

    -

    Bharath

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2018 at 03:02 PM

    This search term gives all BOE APIs added in API hub.

    https://api.sap.com/shell/discover?defaultTab=all&search=Businessobjects

    Note: Not all APIs added here.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2018 at 02:58 PM

    There is no official documentation for JSON request and Response.

    One simple way is :

    Hit API GET method and JSON format.

    Replicate same JSON object in the Request.

    -

    Bharath

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 01, 2018 at 10:26 AM

    Hey Thank you!!! :-)

    It's work!

    Regards Christophe

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.