cancel
Showing results for 
Search instead for 
Did you mean: 

Rstful Webservice create Query based on Universe inJSON

former_member300847
Discoverer
0 Kudos

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/ec55543d6fdb101497906a7cb0e...

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

Accepted Solutions (1)

Accepted Solutions (1)

daniel_paulsen
Active Contributor

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/45f99c666e041014910aba7db0e...

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

Answers (4)

Answers (4)

former_member230921
Active Contributor

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.

former_member230921
Active Contributor

SAP API Business Hub:

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

This provides all required info about the APIs.

-

Bharath

former_member230921
Active Contributor
0 Kudos

Navigate to Artifacts -> click on first item in list.

former_member300847
Discoverer
0 Kudos

Hey Thank you!!! 🙂

It's work!

Regards Christophe

former_member230921
Active Contributor
0 Kudos

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