Skip to Content
0

Rstful Webservice create Query based on Universe inJSON

Feb 27 at 11:10 AM

41

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Best Answer
Daniel Paulsen
Feb 27 at 03:19 PM
1

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

Share
10 |10000 characters needed characters left characters exceeded
Bharath B N
Feb 27 at 02:59 PM
2

SAP API Business Hub:

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

This provides all required info about the APIs.

-

Bharath

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
Bharath B N
Feb 27 at 03:02 PM
2

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.

Share
10 |10000 characters needed characters left characters exceeded
Bharath B N
Feb 27 at 02:58 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 01 at 10:26 AM
0

Hey Thank you!!! :-)

It's work!

Regards Christophe

Share
10 |10000 characters needed characters left characters exceeded