Skip to content

/AWS1/IF_CGS=>REGISTERDEVICE()

About RegisterDevice

Registers a device to receive push sync notifications.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

RegisterDevice The following examples have been edited for readability. POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZN-REQUESTID: 368f9200-3eca-449e-93b3-7b9c08d8e185 X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.RegisterDevice HOST: cognito-sync.us-east-1.amazonaws.com X-AMZ-DATE: 20141004T194643Z X-AMZ-SECURITY-TOKEN: AUTHORIZATION: AWS4-HMAC-SHA256 Credential=, SignedHeaders=content-type;content-length;host;x-amz-date;x-amz-target, Signature=

{ "Operation": "com.amazonaws.cognito.sync.model#RegisterDevice", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "ID_POOL_ID", "IdentityId": "IDENTITY_ID", "Platform": "GCM", "Token": "PUSH_TOKEN" } } 1.1 200 OK x-amzn-requestid: 368f9200-3eca-449e-93b3-7b9c08d8e185 date: Sat, 04 Oct 2014 19:46:44 GMT content-type: application/json content-length: 145

{ "Output": { "__type": "com.amazonaws.cognito.sync.model#RegisterDeviceResponse", "DeviceId": "5cd28fbe-dd83-47ab-9f83-19093a5fb014" }, "Version": "1.0" }

Method Signature

METHODS /AWS1/IF_CGS~REGISTERDEVICE
  IMPORTING
    !IV_IDENTITYPOOLID TYPE /AWS1/CGSIDENTITYPOOLID OPTIONAL
    !IV_IDENTITYID TYPE /AWS1/CGSIDENTITYID OPTIONAL
    !IV_PLATFORM TYPE /AWS1/CGSPLATFORM OPTIONAL
    !IV_TOKEN TYPE /AWS1/CGSPUSHTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgsregdeviceresponse
  RAISING
    /AWS1/CX_CGSINTERNALERROREX
    /AWS1/CX_CGSINVALIDCONFEX
    /AWS1/CX_CGSINVALIDPARAMETEREX
    /AWS1/CX_CGSNOTAUTHORIZEDEX
    /AWS1/CX_CGSRESOURCENOTFOUNDEX
    /AWS1/CX_CGSTOOMANYREQUESTSEX
    /AWS1/CX_CGSCLIENTEXC
    /AWS1/CX_CGSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_identitypoolid TYPE /AWS1/CGSIDENTITYPOOLID /AWS1/CGSIDENTITYPOOLID

A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. Here, the ID of the pool that the identity belongs to.

iv_identityid TYPE /AWS1/CGSIDENTITYID /AWS1/CGSIDENTITYID

The unique ID for this identity.

iv_platform TYPE /AWS1/CGSPLATFORM /AWS1/CGSPLATFORM

The SNS platform type (e.g. GCM, SDM, APNS, APNS_SANDBOX).

iv_token TYPE /AWS1/CGSPUSHTOKEN /AWS1/CGSPUSHTOKEN

The push token.

RETURNING

oo_output TYPE REF TO /aws1/cl_cgsregdeviceresponse /AWS1/CL_CGSREGDEVICERESPONSE

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->registerdevice(
  iv_identityid = |string|
  iv_identitypoolid = |string|
  iv_platform = |string|
  iv_token = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_deviceid = lo_result->get_deviceid( ).
ENDIF.