SAP Mobile Platform 2.3: Developer Guide: REST API Applications
SAP Mobile Platform 2.3: Developer Guide: REST API Applications
SAP Mobile Platform 2.3: Developer Guide: REST API Applications
Prerequisites
Review the prerequisites for developing an HTTP client application to access SAP Mobile
Platform REST services.
Application Requirements
Ensure that application meets the necessary requirements for authentication, user names,
cookies, and client libraries.
Authentication
Set up your HTTP client to use one of four types of authentication.
• Basic authentication – Provide a username and password to login. This method is
available when connecting through HTTP and one-way HTTPS.
• SSO token – Provide an SSO token to login. This method is available when connecting
through HTTP and HTTPS and a token validation service is available and configured.
• X.509 Mutual authentication – Provide a client certificate to login. This method is
available only through an appropriately configured HTTPS listener.
• X.509 Mutual authentication through intermediary – Provide a forwarded client
certificate to login; the forwarded certificate is provided by the SSL_CLIENT_CERT
header. The SSL_CLIENT_CERT header contains a forwarded PEN-encoded client
certificate. This method is available only through an appropriately configured HTTPS
listener. The certificate forwarder must have the "SUP Impersonator" role to be authorized
for this type of login. The certificate of the actual "SUP Impersonator" user cannot be used
as a regular user certificate.
Intermediary refers to the relay server or an apache reverse proxy. The requests are sent on
mutual SSL connection from client to intermediary and then intermediary to SUP. From
client to intermediary, client certificate is used on transport level. From intermediary to
SUP, the impersonator certificate is used on transport level. The client certificate is
forwarded as SSL_CLIENT_CERT HTTP request header.
A request targeting a resource that requires authentication fails with error code 401 unless X.
509 mutual authentication is used to establish a valid authenticated request context (The
certificate validation login module must exist in the security configuration used to
authenticate the request and the certificate validation must be successful and sufficient. If that
is not the case, regular username/password or token authentication is attempted and the
request is authenticated equal to a non X.509 authenticated connection). After three
subsequent failed authentication attempts using the same X-SUP-SESSID, the fourth attempt
fails with a 403 error code.
Authentication Challenges
Your application must be able to respond to standard HTTP authentication challenges.
HTTP Cookies
Ensure that you enable HTTP cookies in your application. See RFC 6265 for information on
standard HTTP cookie processing.
Reverse Proxies
Requirements for third party reverse proxies for use with SAP Mobile Platform.
The reverse proxy must be a straight pass-though proxy server. Ensure the reverse proxy meets
these requirements:
• Does not change the content encoding of the requests or responses. Chunked transfer
encoding is the required data transfer mechanism. Content-length encoding is not
supported.
• Does not remove any HTTP headers.
• The timeout period (if any) must be greater than the timeout used by the clients.
• The resulting URL that is passed to the SAP Mobile Platform must be http://
HostName/[public/]<AppID>, where [public] is optional and if included
anonymous connection is allowed. Example, http://suphost/public/empDir.
Client Libraries
Optionally, you can include certain SAP Mobile Platform or OData client libraries from the
SAP Mobile SDK to enable complex application capabilities, such as OData parsing and
building, or data vault management.
You can include the following libraries if needed by your application:
• Datavault (for secure storage of sensitive data, or password policy capabilities)
• iOS, Android, or BlackBerry clients can use certain OData libraries:
• OData parser (SDM parsing libraries)
• OData Persistence and Cache
Do not include the following libraries:
• SAP Mobile Platform proxy libraries from the OData SDK
• Other native SAP Mobile Platform libraries
1. In SAP Control Center, add a new security configuration using the Security node.
2. In the left navigation pane, expand the Security folder and select the new configuration.
3. Use the Authentication, Authorization, Attribution, and Audit tabs to configure the
appropriate security providers for each aspect of domain security.
4. Edit the security provider properties, as required.
5. Validate the configuration to ensure that SAP Mobile Server accepts the changes.
6. Apply the changes to SAP Mobile Server.
Creating an Application
Create a new application in SAP Mobile Server.
1. In the left navigation pane of SAP Control Center, click the Applications node and select
the Applications tab in the right administration pane.
2. Click New to register an application.
3. In the Application Creation Wizard, enter a unique Application ID.
4. Enter a Display name and Description for the application.
5. Select the appropriate security configuration from the Security configuration drop-down
list.
6. (Optional) For applications that do not require authentication, select the anonymous
security configuration or the Anonymous access checkbox.
7. Select the appropriate domain from the Domain drop-down list.
If you do not select the specific security configuration and domain from the list, the default
values will be considered.
8. Click Finish to register the application with the configured settings.
For more information, see SAP Control Center for SAP Mobile Platform > Administer >
Applications > Defining Applications > Creating REST API Application Definitions.
1. In the left navigation pane, expand the Domains folder, and select the default domain.
2. Select Connections.
3. In the right administration pane, select the Connections tab, and click New.
4. Enter a unique Connection pool name.
5. Select the Proxy Connection pool type.
6. Select the appropriate template for the data source target from the Use template menu.
7. Set the Address property by clicking the corresponding cell and entering the address of the
proxy endpoint. For example, http://odata.example.com/v2/Catalog/
8. Configure the following optional properties:
Note: You must manually enter the EnableHttpProxy and EnableUrlRewrite
properties; these properties are not pre-populated in the menu. To access an external
service, you must configure the http.proxyHost and http.proxyPort properties
during server configuration in SAP Control Center > Servers > Server Configuration >
General > User Options. If you set or change the setting for http.proxyHostand
http.proxyPort, you must restart the services using the stop/start service scripts. For
more information, see Administer > SAP Mobile Server > Configuring SAP Mobile
Server to Securely Communicate With an HTTP Proxy in SAP Control Center for SAP
Mobile Platform .
• Allow Anonymous Access – Enables anonymous authentication to SAP Mobile
Platform.
• Certificate Alias – Client SSL certificate stored in the SAP Mobile Platform keystore
to be forwarded to the EIS.
• Username – Username passed to the EIS.
• Password – Password passed to the EIS.
• EnableHttpProxy – Enables Internet proxy support in the proxy connector.
EnableHttpProxy defaults to false. Set explicitly to true to enable.
• EnableUrlRewrite – Enables the proxy component to rewrite URLs (or URIs)
embedded in a response, with SUP URLs that causes the client requests to be directed
back to the SAP Mobile Server (proxy component), rather than to the back end server.
EnableUrlRewrite defaults to true. Set explicitly to false to disable.
• ProxyHost – Host name of the proxy server.
• ProxyPort – Port number.
Note: On a proxy connection, if the header for X-SUP-BACKEND-URL is not NULL, or
EnableURLRewrite is false then no URL rewrite occurs for either the request or
response content.
Note: To access the external services, you must configure EnableHttpProxy = True,
ProxyHost = proxy, ProxyPort = 8080 in the connection pool.
9. Click OK to register the connection pool.
1. In the left navigation pane, navigate to ClusterName > Domains > DomainName >
Security.
2. In the right administration pane, select the Security Configurations tab and click
Assign.
3. From the list of available security configurations, select the appropriate configuration for
domain security, and click OK.
To allow HTTP clients anonymous access, select the anonymous security configuration,
and to allow authenticated access, select one or more security configurations that you
created.
If successful, an Assigned successfully message appears, and the newly added security
configuration is listed in the domain-level Security node.
Domain is defined by host name and should match with the domain registered with SAP
Mobile Platform. If the requested domain name does not match, default domain will be used.
The resource represents one of the built-in SAP Mobile Platform services for managing
application registration, settings, or customization resource bundles, or one of the configured
Proxy Connection endpoints.
The resource-specific part of the URL specifies the actual resource being referenced.
For accessing services where a Relay Server is configured with the SAP Mobile Server, the
URL you use depends on whether Relay Server is installed on an IIS or Apache host.
For an IIS host:
http://{RelayServerName}:80/ias_relay_server/client/rs_client.dll/
{Unwired Server Farm ID}/[public/]/{ProxyName}
Requests to SAP Mobile Platform require valid transport credentials unless made over a SAP
Mobile Platform protocol (Messaging-based synchronization and its Java implementation) or
they explicitly request a public resource (indicated when a resource in the "public" context is
requested). Each SAP Mobile Platform domain can authenticate requests by using a default
security configuration. If a domain has no default security configuration defined, the default
security configuration, "admin," is used to authenticate the request.
By explicitly setting the HTTP headers, you can override the domain used to resolve the
targeted endpoint, as well as the security configuration used to authenticate a request. For
more information, see HTTP Headers and Cookies on page 23.
The resource part of the URL corresponds to a proxy endpoint name (connection type
PROXY). The SAP Mobile Platform Proxy component handles any request made towards a
configured Proxy Connection Endpoint and later forwards the request to the URL specified in
the connection template.
Example URL
Example of an HTTP URL request.
http://mobile.sap.com/com.sap.mobile.endpointABC/mybackendurl
The "mobile.sap.com" part of the URL refers to the SAP Mobile Platform domain name, and
"com.sap.mobile.endpointABC" is the connection name as defined within the scope of the
SAP Mobile Platform domain "mobile.sap.com".
In SAP Mobile Platform, there must be a proxy endpoint named
"com.sap.mobile.endpointABC" within the "mobile.sap.com" or "default" domains. If the
connection "com.sap.mobile.endpointABC" is undefined, the device receives a 404 error.
either the X-SUP-APPCID cookie or X-SUP-APPCID HTTP header, if supplied). On the first
call you can simplify your client application code by having the application connection ID
determined from the call context, since you have not yet received an application connection
ID.
If you supply an application connection ID, perform an HTTP GET method at the following
URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)
If you do not supply an application connection ID, perform an HTTP GET method at the
following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘*current ’)
You can also retrieve a property value by appending the property name in the URL. For
example, to retrieve the ClientLogLevel property value:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)/ClientLogLevel
The ${ETag}part of the URL is a version identifier included in the response of the GET
method. If the ETag value of the current application settings is the same as the value included
in the request, a status code 304 without a response body is returned to the client to indicate
there are no application settings changes.
Note: The query function is not supported.
b. Select Application > Properties > Push Configurations > Add to configure push
settings in the application properties (setting the GCM server URL, and other
parameters).
• Use the API key from GCM to configure the API key.
3. Perform a one-time registration to enable push notifications for the application:
a. Create an application connection. For example, for Android devices:
POST http://{domain-host-port}/odata/applications/v1/{appid}/
Connections
HTTP Header "Content-Type" = "application/atom+xml"
Body:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://
schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/
dataservices">
<content type="application/xml">
<m:properties>
<d:DeviceModel>Samsung Galaxy S2</d:DeviceModel>
<d:DeviceType>Android</d:DeviceType>
<d:DeviceSubType>Smartphone</d:DeviceSubType>
<d:DevicePhoneNumber>555-555-1212</d:DevicePhoneNumber>
<d:DeviceIMSI>123456</d:DeviceIMSI>
</m:properties>
</content>
</entry>
Note: You can check the "AndroidGcmPushEnabled" value returned from the
registration and only continue with the rest of the GCM/notification registration
processing if it is "true".
b. The application registers with the GCM server, using the value from the
"AndroidGcmSenderId" property, as well as the Android Application ID (which you
build into the application).
A successful GCM registration results in a Registration ID back from Google.
c. Using the ApplicationConnectionId ({appcid}) returned from the SAP Mobile
Platform registration call (in either the "X-SUP-APPCID" HTTP header or the
"ApplicationConnectionId" property), the application should update the
AndroidGcmRegistrationId property for the application connection for your
application by using the GCM Registration ID returned by Google:
PUT http://{domain-host-port}/odata/applications/v1/{appid}/
Connections/('{appcid}')
HTTP Headers "Content-Type" = "application/atom+xml" and "X-
HTTP-METHOD" = "MERGE"
Body:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://
schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/
dataservices">
<content type="application/xml">
<m:properties>
<d:AndroidGcmRegistrationId>{GCM registration ID}</
d:AndroidGcmRegistrationId>
</m:properties>
</content>
</entry>
4. Native mobile listener should be implemented by the application to get the notification.
e. Click OK to save.
2. Enable push notifications in the application itself:
a. Call the registerForRemoteNotificationTypes: method.
b. In your delegate, implement the application:(UIApplication *)app
didRegisterForRemoteNotificationsWithDeviceToken: and
application:(UIApplication *)app
didRegisterReceiveRemoteNotification: methods to receive the
device token and notifications.
c. Create an application connection, and include the ApnsDeviceToken, and DeviceType
properties.
PUT http://{domain-host-port}/odata/applications/v1/{appid}/
Connections/('{appcid}')
HTTP Headers "Content-Type" = "application/atom+xml"
Body:
<?xml version='1.0' encoding='utf-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://
schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/
dataservices" xml:base="http://host:port/odata/applications/
v1/com.example.IOS/">
<id>http://host:port/odata/applications/v1/com.example.IOS/
Connections('32552613-470f-45e0-8acc-b7d73d501682')</id>
<link rel="edit" title="Connection"
href="Connections('32552613-470f-45e0-8acc-b7d73d501682')" />
<category term="applications.Connection" scheme="http://
schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ApnsDeviceToken>{APNS device token received by the
application from APNS}</d:ApnsDeviceToken>
<d:DeviceType>iPhone</d:DeviceType>
</m:properties>
</content>
</entry>
3. Native mobile listener should be implemented by the application to get the notification.
Use the MERGE method to update specified properties. Those properties that you do not
specify retain their current values.
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)
Note: For a list of application connection properties for the HTTP client, see Reference >
Application Connection Properties in Developer Guide: REST API Applications.
The URL contains these components:
• domain – The SAP Mobile Platform domain where the requested resource is resolved or
the name of the SAP Mobile Server.
• port – The port for listening for OData requests; by default, 8000.
• “public” prefix – If included, an anonymous security configuration is used.
• odata/applications/ – Refers to the OData services associated to the application
resources.
• {V1|latest} – The version of the service document.
• appid – The name of the application.
• Connections – The name of the OData collection.
• appcid – The application connection ID of the application instance interacting with the
service.
For general authentication, and resource naming and resolution, apply the rules described in
Application Requirements > Authentication in Developer Guide: REST API Applications.
If the{resourceBundleName} is specified in the URL, the specified resource bundle is
returned in the response body as a stream, otherwise, the resource bundle bound to its
application connection settings is returned.
If the resource bundle is not found in SAP Mobile Platform, error code 404 is returned. You
cannot issue other HTTP methods (PUT/POST/DELETE) at the above URL.
The client must provide user credentials at the transport level (HTTP authentication).
Note: The above URL applies where the server name and domain name match. If they do not
match, use the X-SUP-DOMAIN header to specify the domain name.
Include two main elements in the request:
• The BTX content, which you send as a multipart form request (the standard encoding used
by browsers for HTTP file upload).
• The application identifier (provided in the URL)
For general authentication, and resource naming and resolution, apply the rules described in
Application Requirements > Authentication in Developer Guide: REST API Applications.
Upon receiving the client request, the SAP Mobile Server parses the multipart form request to
gather the BTX content sent by the client and send this content to the SAP® Solution Manager
in another multipart request.
For more information on supportability and the use of SAP Solution Manager with SAP
Mobile Platform, see System Administration.
Reference
Describes REST API resources.
Note: The example in this section use basic authentication, which you can see in the HTTP
header, for example Authorization: Basic Base64-encoded string.
Headers
• X-SUP-DOMAIN – SAP Mobile Platform domain name to override the domain derived
from the URL.
For example, if the “mobile.sap.com” is the domain name requested in URL, but client
wants to use the “mobile.application” domain. In this case, client can send HTTP request
where X-SUP-DOMAIN header value will be “mobile.application”.
• X-SUP-SC – Security configuration to override domain default security configuration.
For example, “mobile.application” domain has two assigned security configurations:
“sc1” and “sc2”, and “sc1” is the default security configuration. By default, the “sc1” will
be used to authenticate user. If client wants to authenticate using “sc2”, it can send HTTP
request with the X-SUP-SC header as “sc2”.
Note: X-SUP-DOMAIN and X-SUP-SC complement each other but do not necessarily
need to be set together. If X-SUP-SC is used, you must associate the security configuration
to the domain in which the request is authenticated to allow a successful connection,
otherwise a 403 error is returned to the device. If a request refers to a non-existent domain
or security configuration, 404 error is returned to the device. If the domain is disabled, a
503 error is returned.
Cookies
Cookies are returned by servers in the HTTP response header (Set-Cookie header) and
included by the HTTP client (for example, a browser) in the subsequent HTTP request header
(cookie header).
• X-SUP-APPCID – Communicates the application connection ID as generated by the
application the request originates from, or as issued by the server during using the X-
SUP-APPCID response header and the permanent X-SUP-APPCID cookie. SAP Mobile
Platform response headers carry the X-SUP-APPCID regardless of whether or not the
incoming request carried a cookie or X-SUP-APPCID header. The X-SUP-APPCID value
has a maximum length of 128 characters. If the request does not carry an X-SUP-APPCID,
the server generates a value automatically.
X-SUP-APPCID is received as a cookie, but sent back to the server either as a cookie or as
a header.
• X-SUP-SECTOKEN – Cookie generated for anonymous registration.
Security token generated to protect anonymous registered application connection settings
not to be changed by other device users.
X-SUP-SECTOKEN is received as a cookie, but sent back to the server either as a cookie
or as a header.
• X-SUP-SESSID – X-SUP-SESSID is the actual JSESSIONID issued by the web
container. If X-SUP-SESSID is provided in the request header, server bypasses the
security configuration check during the session time.
If the X-SUP-SESSID is not provided, the SAP Mobile Platform performs authentication
through security configuration against backend security server.
The default session timeout is 30 minutes. If the session times out, or if the client does not
send the X-SUP-SESSID cookie in the request, a new session is created on the server.
You can change the default timeout by manually adding the session-timeout configuration
into the SMP_HOME\Servers\UnwiredServer\deploy\webapps
\httpchannel\WEB-INF\web.xml file, and restarting the server. You must
manually modify all the nodes:
<web-app>
...
<session-config>
<session-timeout>30</session-timeout>
</session-config>
...
</web-app>
ApnsAlerts Boolean No No
ApnsBadges Boolean No No
ApnsSounds Boolean No No
BlackberryBESListe- Int32 No No
nerPort
Proxy Responses
Proxy responses include all the cookies and headers from the proxied backend. Refer to the
proxy documentation for more details.
Application Connections
Methods for creating, updating, or reading application connections.
Service Document
Get the service document for the application connection. Retrieving the service document
allows the client to discover the capabilities and locations of the available collections.
Syntax
Perform an HTTP GET request at the following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}
Parameters
• appid – The application ID that uniquely identifies the application.
Returns
Returns a 200 OK status code if successful, and a service document in the response body.
Examples
• Service document – HTTP request header:
GET /odata/applications/v1/com.sap.myapp HTTP/1.1
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
The HTTP response body is a service document that describes a single collection named
"Connections” in SAP Mobile Platform:
<?xml version='1.0' encoding='utf-8'?>
<service xmlns="http://www.w3.org/2007/app"
xml:base="http://domain:port/appSettings/odata/v1/appid/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
<collection href="Connections">
<atom:title>Connections</atom:title>
</collection>
</workspace> </service>
Metadata
Get the metadata document that includes the metadata for the application connection settings.
Syntax
Perform an HTTP GET request at the following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
$metadata
Parameters
• appid – The application ID that uniquely identifies the application.
Returns
If successful, returns a 200 OK status code and a metadata document in the response body.
Examples
• Get Metadata – HTTP request header:
GET /odata/applications/v1/com.sap.myapp/$metadata HTTP/1.1
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
xmlns:sup="http://www.sap.com/sup/odata">
<edmx:DataServices m:DataServiceVersion="1.0">
<Schema Namespace="applications" xmlns="http://
schemas.microsoft.com/ado/2006/04/edm
<EntityType Name="Connection">
<Key>
<PropertyRef Name="ApplicationConnectionId" />
</Key>
<Property Name="ETag" Type="Edm.String" Nullable="false"
sup:ReadOnly="true"/>
<Property Name="ApplicationConnectionId" Type="Edm.String"
Nullable="false" sup:ReadOnly="true"/>
<Property Name="AndroidGcmPushEnabled" Type="Edm.Boolean"
Nullable="false" sup:ReadOnly="false" />
<Property Name="AndroidGcmRegistrationId"
Type="Edm.String" Nullable="true" sup:ReadOnly="false" />
<Property Name="AndroidGcmSenderId" Type="Edm.String"
Nullable="true" sup:ReadOnly="true" />
<Property Name="ApnsPushEnable" Type="Edm.Boolean"
Nullable="false" sup:ReadOnly="false" />
<Property Name="ApnsAlerts" Type="Edm.Boolean"
Nullable="false" sup:ReadOnly="false" />
<Property Name="ApnsBadges" Type="Edm.Boolean"
Nullable="false" sup:ReadOnly="false" />
<Property Name="ApnsSounds" Type="Edm.Boolean"
Nullable="false" sup:ReadOnly="false" />
<Property Name="ApnsAlertMessage" Type="Edm.String"
Nullable="true" sup:ReadOnly="true" />
<Property Name="ApnsDeviceToken" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="CustomizationBundleId" Type="Edm.String"
Nullable="true" sup:ReadOnly="true" />
<Property Name="ApplicationVersion" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="ClientSdkVersion" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="BlackberryPushEnabled" Type="Edm.Boolean"
Nullable="false" sup:ReadOnly="false" />
<Property Name="BlackberryDevicePin" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="BlackberryBESListenerPort"
Type="Edm.Int32" Nullable="false" sup:ReadOnly="false" />
<Property Name="CapabilitiesPasswordPolicy"
Type="Edm.Boolean" Nullable="false" sup:ReadOnly="false" />
<Property Name="CustomCustom1" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="CustomCustom2" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="CustomCustom3" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="CustomCustom4" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="DeviceModel" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
<Property Name="DeviceType" Type="Edm.String"
Nullable="true" sup:ReadOnly="false" />
Syntax
Perform an HTTP POST request at the following URL:
http://domain:port/[public/]/odata/applications/{v1|latest}/
{appid}/Connections
Parameters
• appid – The application ID that uniquely identifies the application.
Returns
If successful, a 201 Created status code is returned, and the new application connection
settings are included in the response body.
Examples
• Create application connection – Example HTTP request header:
POST /odata/applications/v1/com.sap.myapp/Connections HTTP/1.1
Content-Length: 4704
Content-Type: application/atom+xml; charset=UTF-8
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
Minimal body:
<?xml version="1.0" encoding="UTF-8"?>
<entry xml:base="http://localhost:8000/public/odata/applications/
v1/com.sap.myapp/"
xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://
schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<content type="application/xml">
<m:properties>
</m:properties>
</content>
</entry>
Syntax
Perform an HTTP GET request at the following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)
Parameters
• appid – The application ID that uniquely identifies the application.
• appcid – The application connection ID of the application instance interacting with the
service.
Returns
If successful, returns a 200 OK status code and an HTTP response body with the application
settings.
Examples
• Get application settings – HTTP request header:
GET /odata/applications/v1/com.sap.myapp/Connections('b6d50e93-
bcaa-439d-9741-660a3cb56771') HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:ETag>2012-06-28 17:55:47.685</d:ETag>
<d:ApplicationConnectionId>c9d8a9da-9f36-4ae5-9da5-37d6d90483b5</
d:ApplicationConnectionId>
<d:AndroidGcmPushEnabled m:type="Edm.Boolean">false</
d:AndroidGcmPushEnabled>
<d:AndroidGcmRegistrationId m:null="true" />
<d:AndroidGcmSenderId m:null="true" />
<d:ApnsPushEnable m:type="Edm.Boolean">true</
d:ApnsPushEnable>
<d:ApnsAlerts m:type="Edm.Boolean">true</d:ApnsAlerts>
<d:ApnsBadgesm:type="Edm.Boolean">true</d:ApnsBadges>
<d:ApnsSounds m:type="Edm.Boolean">true</d:ApnsSounds>
<d:ApnsAlertMessage>New Items Available</d:ApnsAlertMessage>
<d:ApnsDeviceToken m:null="true" />
<d:CustomizationBundleId>TestMDC:1.0</d:
CustomizationBundleId>
<d:ApplicationVersion m:null="true" />
<d:ClientSdkVersion m:null="true" />
<d:BlackberryPushEnabled m:type="Edm.Boolean">true</
d:BlackberryPushEnabled>
<d:BlackberryDevicePin>00000000</d:BlackberryDevicePin>
<d:BlackberryBESListenerPort m:type="Edm.Int32">5011</
d:BlackberryBESListenerPort>
<d:CapabilitiesPasswordPolicy m:type="Edm.Boolean">false</
d:CapabilitiesPasswordPolicy>
<d:CustomCustom1>custom1</d:CustomCustom1>
<d:CustomCustom2 m:null="true" />
<d:CustomCustom3 m:null="true" />
<d:CustomCustom4 m:null="true" />
<d:DeviceModel m:null="true" />
<d:DeviceType>Unknown</d:DeviceType>
<d:DeviceSubType m:null="true" />
<d:DevicePhoneNumber>12345678901</d:DevicePhoneNumber>
<d:DeviceIMSI m:null="true" />
<d:PasswordPolicyEnabled m:type="Edm.Boolean">true</
d:PasswordPolicyEnabled>
<d:PasswordPolicyDefaultPasswordAllowed
m:type="Edm.Boolean">false</
d:PasswordPolicyDefaultPasswordAllowed>
<d:PasswordPolicyMinLength m:type="Edm.Int32">8</
d:PasswordPolicyMinLength>
<d:PasswordPolicyDigitRequired m:type="Edm.Boolean">false</
d:PasswordPolicyDigitRequired>
<d:PasswordPolicyUpperRequired m:type="Edm.Boolean">false</
d:PasswordPolicyUpperRequired>
<d:PasswordPolicyLowerRequired m:type="Edm.Boolean">false</
d:PasswordPolicyLowerRequired>
<d:PasswordPolicySpecialRequired
m:type="Edm.Boolean">false</d:PasswordPolicySpecialRequired>
<d:PasswordPolicyExpiresInNDays m:type="Edm.Int32">0</
d:PasswordPolicyExpiresInNDays>
<d:PasswordPolicyMinUniqueChars m:type="Edm.Int32">0</
d:PasswordPolicyMinUniqueChars>
<d:PasswordPolicyLockTimeout m:type="Edm.Int32">0</
d:PasswordPolicyLockTimeout>
<d:PasswordPolicyRetryLimit m:type="Edm.Int32">20</
d:PasswordPolicyRetryLimit>
<d:ProxyApplicationEndpointm:null="true" />
<d:ProxyPushEndpoint>http://domain:8000/GWC/
SUPNotification</d:ProxyPushEndpoint>
</content>
</entry>
Syntax
Perform an HTTP GET request at the following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)/<property-name>
Parameters
• appid – The application ID that uniquely identifies the application.
• appcid – The application connection ID of the application instance interacting with the
service.
• property-name – The property-name can be appended to the URL to retrieve the value of
a specific property.
Returns
If successful, returns a 200 OK status code and an HTTP response body with the application
settings.
Examples
• Get the DeviceType property – HTTP request:
GET /odata/applications/v1/com.sap.myapp/Connections('b6d50e93-
bcaa-439d-9741-660a3cb56771')/DeviceType HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
Set-Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771
DataServiceVersion: 1.0
Date: Mon, 13 Aug 2012 23:00:27 GMT
Transfer-Encoding: chunked
Syntax
PUT http://domain:port/[public/]odata/applications/{v1|latest}/
{appid}/Connections(‘{appcid}’)
Parameters
• appid – The application ID that uniquely identifies the application.
• appcid – The application connection ID of the application instance interacting with the
service.
Returns
When processing a PUT request, SAP Mobile Platform returns a 200 status code to indicate
success, and there is no response body.
If you never explicitly registered the client, returns a 404 status code.
Examples
• Update application settings (PUT) – HTTP request header:
PUT /odata/applications/v1/com.sap.myapp/Connections('b6d50e93-
bcaa-439d-9741-660a3cb56771') HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Content-Length: 4744
Content-Type: application/atom+xml; charset=UTF-8
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771
DataServiceVersion: 1.0
Date: Mon, 13 Aug 2012 23:07:51 GMT
Content-Length: 0
Syntax
Perform a MERGE request at the following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)
Parameters
• appid – The application ID that uniquely identifies the application.
• appcid – The application connection ID of the application instance interacting with the
service.
Returns
If successful, returns a 200 OK status code.
If you never explicitly registered the client, returns a 404 status code.
Examples
• Update application settings (MERGE) – HTTP request header:
POST /odata/applications/v1/com.sap.myapp/Connections('b6d50e93-
bcaa-439d-9741-660a3cb56771') HTTP/1.1
X-HTTP-METHOD:MERGE
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Content-Length: 4768
Content-Type: application/atom+xml; charset=UTF-8
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
xmlns:d="http://schemas.microsoft.com/ado/2007/08/
dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/
dataservices/metadata">
<title type="text"/>
<updated>2012-06-15T02:23:29Z</updated>
<author>
<name/>
</author>
<category term="applications.Connection" scheme="http://
schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:DeviceType>Unknown</d:DeviceType>
…
</m:properties>
</content>
</entry>
Syntax
Perform an HTTP DELETE request at the following URL:
http://domain:port/[public/]odata/applications/{v1|latest}/{appid}/
Connections(‘{appcid}’)
Parameters
• appid – The application ID that uniquely identifies the application.
• appcid – The application connection ID of the application instance interacting with the
service.
Returns
If successful, returns a 200 OK status code.
If you never explicity registered the client, returns a 404 status code.
Examples
• Delete application connection – HTTP request:
DELETE /odata/applications/v1/com.sap.myapp/
Connections('b6d50e93-bcaa-439d-9741-660a3cb56771') HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
HTTP response:
HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771
DataServiceVersion: 1.0
Date: Mon, 13 Aug 2012 23:19:42 GMT
Content-Length: 0
Syntax
Perform an HTTP GET request at the following URL:
http://domain:port/[public/] bundles/{appid}/[{resourceBundleName}]
Parameters
• resourceBundleName – Optionally specifies a resource bundle to be returned.
Returns
If you specify the {resourceBundleName} in the URL, the specified resource bundle is
returned in the response body as a stream. Otherwise, the resource bundle bound to its
application connection settings is returned.
Examples
• Download – HTTP request:
GET /bundles/com.sap.myapp/MyApp:1.0 HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
HTTP response:
HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771
Transfer-Encoding: chunked
Usage
For information on the format of customization resource bundles, see Administer >
Applications > Maintaining Activated Applications > Modifying Application Properties >
Application Customization Resource Bundles in SAP Control Center for SAP Mobile
Platform.
Business Transactions
Methods for uploading business transactions.
Upload BTX
Access the Business Transaction XML upload service to upload business transactions for
tracing.
Upon receiving the client request, the SAP Mobile Server parses the multipart form request to
gather the Business Transaction content sent by the client and sends this content to the SAP
Solution Manager in another multipart request.
Syntax
Perform a POST request to the following URL:
http://domain:port/[public/]btx/{appid}
Parameters
None.
Returns
On successful upload, the client receives a 201 Created status code. Otherwise, an HTTP
failure code and failure message are returned.
Examples
• Upload Business Transaction – HTTP request header:
POST /btx/com.sap.myapp/ HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Content-Length: 40
Content-Type: application/atom+xml; charset=UTF-8
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
Usage
Use this method to support your application using SAP Solution Manager. See SAP Solution
Manager documentation for more information.
Proxy Connections
Methods for accessing proxy connections.
Syntax
Perform an HTTP request at the following URL:
http://domain:port/[public/]/{proxyName}
Parameters
• proxyName – URL represents one of the configured proxy connection endpoints (data
services exposed through SAP Mobile Platform) whitelisted.
Returns
If successful, returns a 200 OK status code and a response body.
Examples
• Access external service – HTTP request header:
GET /com.sap.myapp HTTP/1.1
Cookie: X-SUP-APPCID=b6d50e93-bcaa-439d-9741-660a3cb56771; X-SUP-
SESSID=97ts80gwhxkc
Host: supserver:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.3 (java 1.5)
Authorization: Basic REVWMDAwMTppbml0aWFs
Index
A
application connection template 10 R
D Relay Server installation
documentation roadmap 3 pass-through mode for HTTP clients 6
domain security configuration
creating 8