Show TOC

Creating an Application ConnectionLocate this document in the navigation structure

You must explicitly register an application connection with mobile platform.

You can specify customized application properties for client requests. Provide the application connection ID, X-SMP-APPCID, using an explicit request header or a cookie. If the connection ID is missing, mobile platform generates a universally unique ID (UUID), which is communicated to the device through the response cookie X-SMP-APPCID.

Create an anonymous or authenticated application connection by issuing a POST request to this URL, including the application connection properties:

  • On-Premise
    http[s]://<host>:<port>/[public]/odata/applications/{latest|v1}/<appid>/Connections
  • Cloud
    https://<HMC base URL>/odata/applications/{latest|v1}/<appid>/Connections 

A URL contains these components:

  • host – the host name should match the domain registered with mobile platform. If the requested domain name does not match, a default domain is used..
  • port – the port for listening to OData-based requests. By default, the port number is 8080.
  • HMC base URL – application URL provided on accounts page. Each tenant of the account has a different application URL. For example, mobile<<account_name>>- <<tenantname>>.hana.ondemand.com.
  • public – (optional) if included, an anonymous connection is allowed.
  • odata/applications/ – refers to the OData services associated with the application resources.
  • {latest|v1} – version of the service document.
  • appid – application ID.
  • Connections – name of the OData collection.

Application connection properties are optional. You can create an application connection without any application properties.

DeviceType is an application connection property that you may set. Valid values for DeviceType are:

  • Android – Android devices.
  • iPhone – Apple iPhone.
  • iPad – Apple iPad.
  • iPod – Apple iPod.
  • iOS – iOS devices.
  • Blackberry – Blackberry devices.
  • Windows – includes desktop or servers that use the Windows operating system such as Windows XP, Windows Vista, Windows 7, and Windows Server series OS.
  • WinPhone8 – includes Windows mobile.
  • Windows8 – includes Windows desktop version.

Specifying any other value for DeviceType returns "Unknown" in the DeviceType column.

Note HTTP based RESTful APIs must specify the data type (atom+xml or json) in the content-type header. For XML data type, the POST request contains the HTTP header content-type as application/atom+xml; otherwise, server returns 500 Internal Server error. For JSON data, POST request contains HTTP header content-type as application/json.
Creating an Application Connection

Request:

<?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">
<content type="application/xml">
<m:properties>
<d:DeviceType>Android</d:DeviceType>
</m:properties>
</content>
</entry>

Response:

<?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="https://<smp base URL>/odata/applications/latest/e2eTest/">

<id>https://<application URL>/odata/applications/latest/e2eTest/Connections('4891dd0f-0735-47cc-a599-76bf8a16d457')</id>
<title type="text" />
<updated>2012-10-19T09:05:25Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Connection" href="Connections('4891dd0f-0735-47cc-a599-76bf8a16d457')" />
<category term="applications.Connection" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
 <m:properties>
	<d:ETag>2012-10-19 14:35:24.0</d:ETag>
	<d:ApplicationConnectionId>4891dd0f-0735-47cc-a599-76bf8a16d457</d:ApplicationConnectionId>
	<d:AndroidGcmPushEnabled m:type="Edm.Boolean">false</d:AndroidGcmPushEnabled>
	<d:AndroidGcmRegistrationId>398123745023</d AndroidGcmRegistrationId>
	<d:AndroidGcmSenderId />
	<d:ApnsPushEnable m:type="Edm.Boolean">false</d:ApnsPushEnable>
	<d:ApnsDeviceToken />
	<d:ApplicationVersion>1.0</d:ApplicationVersion>
	<d:BlackberryPushEnabled m:type="Edm.Boolean">false</d:BlackberryPushEnabled>
	<d:BlackberryDevicePin m:null="true" />
	<d:BlackberryBESListenerPort m:type="Edm.Int32">0</d:BlackberryBESListenerPort>
	<d:BlackberryPushAppID m:null="true" />
	<d:BlackberryPushBaseURL m:null="true" />
	<d:BlackberryPushListenerPort m:type="Edm.Int32">0</d:BlackberryPushListenerPort>
	<d:BlackberryListenerType m:type="Edm.Int32">0</d:BlackberryListenerType>
	<d:CustomizationBundleId />
	<d:CustomCustom1 />
	<d:CustomCustom2 />
	<d:CustomCustom3 />
	<d:CustomCustom4 />
	<d:DeviceModel m:null="true" />
	<d:DeviceType>Unknown</d:DeviceType>
	<d:DeviceSubType m:null="true" />
	<d:DevicePhoneNumber m:null="true" />
	<d:DeviceIMSI m:null="true" />
	<d:PasswordPolicyEnabled m:type="Edm.Boolean">false</d:PasswordPolicyEnabled>
	<d:PasswordPolicyDefaultPasswordAllowed m:type="Edm.Boolean">false</d:PasswordPolicyDefaultPasswordAllowed>
	<d:PasswordPolicyMinLength m:type="Edm.Int32">0</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">0</d:PasswordPolicyRetryLimit>
	<d:ProxyApplicationEndpoint>http://<backend URL></d:ProxyApplicationEndpoint>
	<d:ProxyPushEndpoint>http[s]://<host:port>/Push</d:ProxyPushEndpoint>
    <d:MpnsChannelURI m:null="true" />
    <d:WnsChannelURI m:null="true" />
</m:properties>
</content>
</entry>