Skip to content

API for Amazon Cognito Sync

ABAP Package /AWS1/API_CGS_IMPL
ABAP SDK "TLA" CGS
ABAP Interface /AWS1/IF_CGS

The "TLA" is a Three Letter Abbreviation that appears in ABAP class names, data dictionary objects and other ABAP objects throughout the AWS SDK for SAP ABAP. The TLA for Amazon Cognito Sync is CGS. This TLA helps squeeze ABAP objects into the 30-character length limit of the ABAP data dictionary.

Installation

To install the AWS SDK for SAP ABAP, import the Core transport, along with the transport for the Cognito Sync module and other API modules you are interested in. A few modules are included in the Core transport itself. For more information, see the Developer Guide guide.

About The Service

Amazon Cognito Sync

Amazon Cognito Sync provides an AWS service and client library that enable cross-device syncing of application-related user data. High-level client libraries are available for both iOS and Android. You can use these libraries to persist data locally so that it's available even if the device is offline. Developer credentials don't need to be stored on the mobile device to access the service. You can use Amazon Cognito to obtain a normalized user ID and credentials. User data is persisted in a dataset that can store up to 1 MB of key-value pairs, and you can have up to 20 datasets per user identity.

With Amazon Cognito Sync, the data stored for each identity is accessible only to credentials assigned to that identity. In order to use the Cognito Sync service, you need to make API calls using credentials retrieved with Amazon Cognito Identity service.

If you want to use Cognito Sync in an Android or iOS application, you will probably want to make API calls via the AWS Mobile SDK. To learn more, see the Developer Guide for Android and the Developer Guide for iOS.

Using the SDK

In your code, create a client using the SDK module for Amazon Cognito Sync, which is created with factory method /AWS1/CL_CGS_FACTORY=>create(). In this example we will assume you have configured an SDK profile in transaction /AWS1/IMG called ZFINANCE.

DATA(go_session)   = /aws1/cl_rt_session_aws=>create( 'ZFINANCE' ).
DATA(go_cgs)       = /aws1/cl_cgs_factory=>create( go_session ).

Your variable go_cgs is an instance of /AWS1/IF_CGS, and all of the operations in the Amazon Cognito Sync service are accessed by calling methods in /AWS1/IF_CGS.

API Operations

For an overview of ABAP method calls corresponding to API operations in Amazon Cognito Sync, see the Operation List.

Factory Method

/AWS1/CL_CGS_FACTORY=>create( )

Creates an object of type /AWS1/IF_CGS.

IMPORTING

Optional arguments:

IV_PROTOCOL TYPE /AWS1/RT_PROTOCOL /AWS1/RT_PROTOCOL

IO_SESSION TYPE REF TO /AWS1/CL_RT_SESSION_BASE /AWS1/CL_RT_SESSION_BASE

IV_REGION TYPE /AWS1/RT_REGION_ID /AWS1/RT_REGION_ID

IV_CUSTOM_ENDPOINT TYPE /AWS1/RT_ENDPOINT /AWS1/RT_ENDPOINT

RETURNING

OO_CLIENT TYPE REF TO /AWS1/IF_CGS /AWS1/IF_CGS

/AWS1/IF_CGS represents the ABAP client for the Cognito Sync service, representing each operation as a method call. For more information see the API Page page.

Configuring Programmatically

DATA(lo_config) = DATA(go_cgs)->get_config( ).

lo_config is a variable of type /AWS1/CL_CGS_CONFIG. See the documentation for /AWS1/CL_CGS_CONFIG for details on the settings that can be configured.