cURL Examples

The cURL tool has excellent support for HTTP requests. The following examples illustrate the cURL commands to run either on Microsoft Windows or on UNIX to send HTTP requests. See the cURL documentation for more information.

Example

GET Universe Details (Microsoft Windows)
curl -G -i -H "accept:application/xml" -H X-SAP-LogonToken:"""%tokenValue%""" "<base_webi_REST_URL>/universes/5808"

Example

GET Universe Details (UNIX)
Note You use the logtok variable set at login.
curl -H "accept:application/xml" -H 'X-SAP-LogonToken:"$logtok"' "<base_sl_REST_URL>/universes/5808"

Example

GET Document Details in French Locale

This example uses the X-SAP-PVL variable.

curl -G -i -H "accept:application/xml" "X-SAP-PVL:fr-FR" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/12345"

Example

POST Document

You create an empty document whose name and folder are described in the newdocument.xml file passed as an argument.

curl -i -X "POST" -H "accept:application/xml" -H "content-type:application/xml" -H X-SAP-LogonToken:"""%tokenValue%"""
 -d "@newdocument.xml" "<base_webi_REST_URL>/documents"

Example

PUT Document Alerter

You update the definition of an alerter for a specified document. The new definition is contained in the alerter4.xml file passed as an argument.

curl -i -X "PUT" -H "accept:application/xml" -H "content-type:application/xml" -H X-SAP-LogonToken:"""%tokenValue%"""
 -d "@alerter4.xml" "<base_webi_REST_URL>/documents/5022/alerters/?alerterId=2"

Example

DELETE

You delete a document schedule.

curl -i -X "DELETE" -H "accept:application/xml" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/4986/schedules/9372"