Creating an Application Connection

You must explicitly register the application connection using SAP Mobile Platform.

You can specify customized application properties for the client with the request. Provide the application connection ID, X-SMP-APPCID, using an explicit request header or a cookie. If the value is missing, SAP 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:
http[s]://<host:port>/[public/]/odata/applications/{latest|v1}/{appid}/Connections 

The URL contains these components:

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

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

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

Example of 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">
    <category term="applications.Connection" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
	<content type="application/xml">
        <m:properties>
           <d:AndroidGcmRegistrationId>398123745023</d AndroidGcmRegistrationId>
        </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>

CORS Support

Cross-domain HTTP requests are requests for resources from a different domain than the domain of the resource making the request. Cross-Origin Resource Sharing (CORS) mechanism provides a way for web servers to support cross-site access controls, which enable secure cross-site data transfers.