Skip to Content
avatar image
Former Member

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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Feb 27 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 comment
    10|10000 characters needed characters exceeded

  • Feb 27 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 comment
    10|10000 characters needed characters exceeded

  • Feb 27 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 comment
    10|10000 characters needed characters exceeded

  • Feb 27 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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 01 at 10:26 AM

    Hey Thank you!!! :-)

    It's work!

    Regards Christophe

    Add comment
    10|10000 characters needed characters exceeded