### Example: Rendering Screen-Set on Standard Page
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/417e847770b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
This example demonstrates how to render the 'custom-registration-login' screen-set, starting with 'custom-register-screen', in a specific container ID on a standard page.
```xml
params
gigya-registration
custom-registration-login
custom-register-screen
test
```
--------------------------------
### Full SAP Customer Data Cloud Integration Example in C#
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/4166c7e270b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Demonstrates a complete workflow: obtaining a JWT token, querying accounts using `accounts.search` with pagination (cursor), and reusing the token for subsequent requests. Includes setup for HttpClient and credential retrieval.
```csharp
using System.Net.Http.Headers;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Oauth2Example;
///
/// This is a demo code with a sole purpose of showing how to get an access token and how to use it.
/// It is not intended to showcase best practices in C# or any other language or eco-system.
///
/// This example should work with any C# version above 6 on windows, linux and osx.
/// To test this code on your own site/data, update the method
/// with the relevant userkey, secret and APIkey.
///
/// Do not commit this code to a public repository to avoid accedental credentials leakage
///
public class Program {
public static async Task Main() {
var (userKey, secret, apikey, tokenDc, domain) = GetCredentials();
// Try to reuse HttpClient as per Microsoft best practices.
// Refer to https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines
using
var client = new HttpClient() {
BaseAddress = new Uri($"https://{domain}", UriKind.RelativeOrAbsolute)
};
await Console.Out.WriteLineAsync($"getting token...{Environment.NewLine}");
// Reuse the same token as long as it is valid, renew when it is not.
var token = await GetOauth2Token(userKey, secret, tokenDc);
await Console.Out.WriteLineAsync($"Got: {token}{Environment.NewLine}");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var cursor = string.Empty;
var values = new Dictionary < string,
string > ();
do {
FillRequestParameters(apikey, cursor, values);
var request = await client.PostAsync($"accounts.search", new FormUrlEncodedContent(values));
```
--------------------------------
### Krux Output Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/50c820ed1a0d4d3caed088838550087e.html
Illustrates the output format for the Krux integration, showing user GUIDs and associated attribute-value pairs delimited by a caret.
```text
User1234^"gender":"male","age":"24"
User2345^"gender":"female"
User3456^"age":"35-44"
```
--------------------------------
### Initialize Gigya Web SDK and Get Organization Context
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/3c6dcda64e7647f7a65f3ab8c343daa5.html?locale=en-US&state=PRODUCTION&version=SHIP
This example demonstrates how to include the Gigya Web SDK and then call the accounts.b2b.getOrganizationContext method with a callback to log the response. Ensure you replace 'ENTER-YOUR-API-KEY-HERE' with your actual API key.
```javascript
```
--------------------------------
### Response Example for Configuration
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/4156b2a270b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
This snippet shows an example response for retrieving configuration details.
```APIDOC
## GET /websites/help_sap_sap_customer_data_cloud_8b8d6fffe113457094a17701f63e3d6a
### Description
Retrieves configuration details for the SAP Customer Data Cloud.
### Method
GET
### Endpoint
/websites/help_sap_sap_customer_data_cloud_8b8d6fffe113457094a17701f63e3d6a
### Response
#### Success Response (200)
- **config** (object) - Contains configuration settings.
- **name** (string) - The name of the configuration.
- **entityID** (string) - The entity ID.
- **nameIDFormat** (string) - The NameID format.
- **singleSignOnServiceUrl** (string) - The SSO service URL.
- **singleSignOnServiceBinding** (string) - The SSO service binding.
- **signAuthnRequest** (boolean) - Whether to sign authentication requests.
- **requireSAMLResponseSigned** (boolean) - Whether SAML responses must be signed.
- **requireAssertionSigned** (boolean) - Whether assertions must be signed.
- **requireAssertionEncrypted** (boolean) - Whether assertions must be encrypted.
- **statusCode** (integer) - The HTTP status code of the response.
- **errorCode** (integer) - An error code, 0 indicates success.
- **statusReason** (string) - A reason for the status.
- **callId** (string) - A unique identifier for the call.
- **time** (string) - The timestamp of the response.
#### Response Example
```json
{
"config": {
"name": "https://idp.testshib.org/idp/shibboleth",
"entityID": "https://idp.testshib.org/idp/shibboleth",
"nameIDFormat": "urn:mace:shibboleth:1.0:nameIdentifier",
"singleSignOnServiceUrl": "https://idp.testshib.org/idp/profile/SAML2/POST/SSO",
"singleSignOnServiceBinding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
"signAuthnRequest": false,
"requireSAMLResponseSigned": true,
"requireAssertionSigned": false,
"requireAssertionEncrypted": false
},
"statusCode": 200,
"errorCode": 0,
"statusReason": "OK",
"callId": "811ee6f788944d7da5c72ba4138ebc14",
"time": "2015-03-22T11:42:25.943Z"
}
```
```
--------------------------------
### Response Example: Before Address Selection
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/6fa4e911e0f245bbb185cb662d1132a4.html
Example of the API response when a user starts typing but has not yet selected an address suggestion.
```APIDOC
## Response Example
Response when a user starts typing but before selecting an option:
```json
{
"callId": "027ec689374a4d95b189eb2e3944d429",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2023-11-17T08:44:10.022Z",
"suggestions": [
{
"address": "Hasso-Plattner-Ring 7, 69190 Walldorf, Deutschland",
"id": "here:af:streetsection:Vz8PyX4tJUQtim7lQZFlCD:EAIaATc"
},
{
"address": "Hasso-Plattner-Ring 7, 69190 Walldorf, Deutschland",
"id": "here:af:streetsection:2U8RFiItg6Sdsz7x5zdu.D:EAIaATc"
}
],
"address": {
"country": "",
"countryISOCode2": "",
"countryISOCode3": "",
"zipCode": "",
"city": "",
"street": "",
"houseNumber": "",
"neighborhood": "",
"building": "",
"entrance": "",
"floor": "",
"apartment": "",
"postOfficeBox": ""
}
}
```
```
--------------------------------
### WebSDK Configuration Examples for Site Groups
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/9efcadea3b3f4cc4a8114dd29dd776bc.html?locale=en-US&state=PRODUCTION&version=SHIP
Examples demonstrating how parent and child site configurations interact, and how to append child settings to parent settings instead of overriding them.
```javascript
{
enabledProviders: ['facebook']
}
```
```javascript
{
enabledProviders: ['twitter']
}
```
```javascript
{
enabledProviders: (siteGroupGlobalConf.enabledProviders || []).concat(['twitter'])
}
```
--------------------------------
### Example Implementation of Screen-Set Blocks
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/417e847770b21014bbc5a10ce4041860.html
Concrete examples showing how to render specific screen-sets with custom parameters in standard and checkout pages.
```xml
params
gigya-registration
custom-registration-login
custom-register-screen
test
```
```xml
params
your-container-id
Default-RegistrationLogin
gigya-login-screen
```
--------------------------------
### Sample Gigya API GET Request
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/4166c7e270b21014bbc5a10ce4041860.html
An example of a simple HTTP GET request to the Gigya API. This format is used for basic status updates.
```http
https://socialize.us1.gigya.com/socialize.setStatus?status=Hello
```
--------------------------------
### Complete Delegated Admin Implementation Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/09a37f7d070c493a8fc7500dc0ccf042.html?locale=en-US&state=PRODUCTION&version=SHIP
A full HTML page example demonstrating screen-set registration, login, delegated admin access, and logout.
```html
Mobile Ready Screen - Set Implementation Example
Organization Registration
Login
Delegated Admin Console
Logout
```
--------------------------------
### Full Screen-Set Implementation Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/414f234370b21014bbc5a10ce4041860.html
A complete HTML example demonstrating the integration of the Web SDK, viewport meta tag, screen-set triggers, and a logout callback.
```html
Mobile Ready Screen-Set Implementation Example
Login |
Register
Edit Your Profile
Logout
```
--------------------------------
### SAML SSO Continue Request Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/d615d93221b74cfcbcd3487a2765e34a.html
Example of a GET request to the continue endpoint, including the required samlContext, loginToken, and an optional state parameter.
```http
GET https://api-prefix-au-saml-idp-1.example.com/saml/v2.0//idp/sso/continue?samlContext=&loginToken=&state=someOpaqueString HTTP/1.1
```
--------------------------------
### Example: Rendering Screen-Set on One-Page Checkout
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/417e847770b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
This example shows how to integrate the 'Default-RegistrationLogin' screen-set, starting with 'gigya-login-screen', into the one-page checkout flow, specifying a container ID.
```xml
params
your-container-id
Default-RegistrationLogin
gigya-login-screen
```
--------------------------------
### Implement Mobile-Ready Organization Registration Screen-Set
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/09a37f7d070c493a8fc7500dc0ccf042.html?locale=en-US&state=PRODUCTION&version=SHIP
Full HTML example demonstrating the required viewport meta tag, Web SDK script inclusion, and the registration link trigger.
```html
Mobile Ready Screen - Set Implementation Example
Organization Registration
```
--------------------------------
### GET Request Parameters
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/6885355cbe784e33bde4d7f3335a300b.html
Examples of various query parameters used to filter, sort, and paginate user data.
```text
...Users?attributes=emails
```
```text
.../Users?startIndex=1&count=10
```
```text
.../Users?startIndex=10&count=100
```
```text
.../Users?filter=userName eq "example"
```
```text
.../Users?sortBy=userName&sortOrder=descending
```
--------------------------------
### accounts.b2b.setup.bootstrap API Response Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/0859deceb0f44a2c80dfe36d2f87f359.html
This is a sample JSON response from the accounts.b2b.setup.bootstrap API, indicating a successful pre-configuration operation. It includes transaction details, error codes, API version, status, and authorization workspace information.
```json
{
"callId": "70ad65c437824b18b857c8c1b7a2cc6c",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2023-02-20T13:10:35.617Z",
"authWorkspaces": [
The `accounts.b2b.setup.bootstrap` API is used to pre-configure SAP Customer Data Cloud B2B for immediate use with selected applications. This is particularly useful for setting up integrations with applications like SAP Commerce. The API requires specific parameters to define the integration target and may optionally accept authorization parameters for server-to-server calls to avoid client-side rate limits. The response provides details about the transaction, including a unique call ID, error code, API version, status, and information about authorization workspaces. The `integration` parameter defaults to `SAP-Commerce` if not specified. The API endpoint is `https://accounts./accounts.b2b.setup.bootstrap`, where `` should be replaced with the appropriate data center identifier (e.g., `us1.gigya.com`).
```
--------------------------------
### Python: Get Lite Token
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/413560f270b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Example of obtaining a lite token in Python. This code requires the GSSDK library and your site's API credentials.
```Python
from GSSDK import *
# Define the API and Secret key (the keys can be obtained from your site setup page in the Gigya console).
apiKey = "PUT-YOUR-APIKEY-HERE"
secretKey = "PUT-YOUR-SECRET-KEY-HERE"
userKey = "PUT-YOUR-USER/APPLCIATION-KEY-HERE"
# Step 1 - Defining the request and adding parameters
method = "accounts.getLiteToken"
params = {
"email":"bob@bob.com",
"sessionExpiration":3600
}
request = new GSRequest(apiKey,secretKey,method,params,userKey)
# Step 2 - Sending the request
response = request.send()
# Step 3 - handling the request's response.
if (response.getErrorCode()==0):
# SUCCESS! response status = OK
print "Success in accounts.getLiteToken operation."
else:
# Error
print "Got error on accounts.getLiteToken: " + response.getErrorMessage()
# You may also log the response: response.getLog()
```
--------------------------------
### accounts.b2b.setup.bootstrap
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/7aec4ac2abd9437581aefef72fe98ca6.html
Pre-configures SAP Customer Data Cloud B2B for immediate use.
```APIDOC
## POST accounts.b2b.setup.bootstrap
### Description
This API pre-configures SAP Customer Data Cloud B2B for immediate use with selected applications.
```
--------------------------------
### Complete RaaS Screen-Set Implementation Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/414f234370b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
This comprehensive HTML example integrates the SAP Customer Data Cloud SDK, viewport meta tag, and includes links for login, registration, profile update, and logout with a callback function for logout confirmation.
```html
Mobile Ready Screen-Set Implementation Example
Login |
Register
Edit Your Profile
Logout
```
--------------------------------
### Get All Trusted Issuers REST API Response
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/677e2ecbf54d4fc6803eafecaefbdf78.html?locale=en-US&state=PRODUCTION&version=SHIP
This JSON response shows an example of the data returned by the fidm.oidc.op.trustedIssuers.getAll API, including details about trusted issuers.
```json
{
"callId": "d88c9d3a1b054f73adb39ee3d3f8e89a",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2025-08-05T15:26:14.258Z",
"trustedIssuers": [
{
"siteId": 7686811,
"partnerId": 2195101,
"issuer": "fake",
"description": "test value",
"discoveryUrl": "https://example.com/discovery.php",
"tokenClaim": "sub",
"cdcFieldClaim": "UID",
"trustedAudiences": [
"faker"
],
"allowedAudiences": [
"blah"
],
"scopes": [
"email",
"phone",
"profile",
"uid"
],
"tokenTTL": 3600
}
]
}
```
--------------------------------
### Get User Communications Response Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/1534dd2199d9423ab621148a67912134.html?locale=en-US&state=PRODUCTION&version=SHIP
This is a sample JSON response for the accounts.communications.getUserCommunications API call. It includes details about the user's communication preferences and opt-in status.
```json
{
"callId": "019b92c5eb1fxxxxxxxxxx6fdebe1881",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2026-01-06T10:06:44.216Z",
"uid": "snipped",
"email": "snipped",
"communications": {
"push_whatsapp": {
"topic": "push",
"doubleOptIn": {
"confirmTime": "2024-11-14T09:12:17.014Z",
"status": "confirmed",
"pendingTime": "2024-11-14T09:10:34.594Z"
},
"lastModified": "2024-11-14T09:10:34.497Z",
"channel": "whatsApp",
"lastModifiedTimestamp": 1731575434,
"status": "optIn",
"verification": "external"
}
}
}
```
--------------------------------
### Full OAuth 2.0 Implementation Example in C#
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/4166c7e270b21014bbc5a10ce4041860.html
Demonstrates the complete flow of obtaining a token and executing a paginated accounts.search query. Do not store credentials in source code for production applications.
```csharp
using System.Net.Http.Headers;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Oauth2Example;
///
/// This is a demo code with a sole purpose of showing how to get an access token and how to use it.
/// It is not intended to showcase best practices in C# or any other language or eco-system.
///
/// This example should work with any C# version above 6 on windows, linux and osx.
/// To test this code on your own site/data, update the method
/// with the relevant userkey, secret and APIkey.
///
/// Do not commit this code to a public repository to avoid accedental credentials leakage
///
public class Program {
public static async Task Main() {
var (userKey, secret, apikey, tokenDc, domain) = GetCredentials();
// Try to reuse HttpClient as per Microsoft best practices.
// Refer to https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines
using
var client = new HttpClient() {
BaseAddress = new Uri($"https://{domain}", UriKind.RelativeOrAbsolute)
};
await Console.Out.WriteLineAsync($"getting token...{Environment.NewLine}");
// Reuse the same token as long as it is valid, renew when it is not.
var token = await GetOauth2Token(userKey, secret, tokenDc);
await Console.Out.WriteLineAsync($"Got: {token}{Environment.NewLine}");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var cursor = string.Empty;
var values = new Dictionary < string,
string > ();
do {
FillRequestParameters(apikey, cursor, values);
var request = await client.PostAsync($"accounts.search", new FormUrlEncodedContent(values));
```
--------------------------------
### Get JWT Public Key (.NET)
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/41354df770b21014bbc5a10ce4041860.html
Use this .NET code to retrieve the JWT public key from SAP Customer Data Cloud. Ensure you have the Gigya.Socialize.SDK installed.
```.NET
using System;
using Gigya.Socialize.SDK;
class Program {
static void Main(string[] args)
{
const string apiKey = "Enter-Your-API-Key-Here";
const string secretKey = "Enter-Your-Secret-Key-Here";
string method = "accounts.getJWTPublicKey";
GSRequest request = new GSRequest(apiKey, secretKey, method, true);
request.SetParam("apiKey","A-Valid-API-Key-For-Target-Site");
GSResponse response = request.Send();
if (response.GetErrorCode() == 0)
{
// Everything's okay
GSObject resObj = response.GetData();
// Do something with the data
}
else
{
Console.WriteLine("Uh-oh, we got the following error:{0}", response.GetLog());
}
}
}
```
--------------------------------
### Site Registration - Kotlin
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/4142e7a870b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Provides a Kotlin example for registering a new user with email and password, demonstrating how to include custom parameters such as session expiration. This is for creating new site accounts.
```kotlin
/*
Registering with a custom session expiration parameter.
*/
mGigya.register("email", "password", mutableMapOf("sessionExpiration" to 10), object : GigyaLoginCallback() {
override fun onSuccess(obj: MyAccount) {
// Success
}
override fun onError(error: GigyaError) {
// Fail
}
})
```
--------------------------------
### Get JWT Public Key (PHP)
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/41354df770b21014bbc5a10ce4041860.html
This PHP example illustrates how to fetch the JWT public key. It requires including the GSSDK.php file and setting your API and secret keys.
```PHP
setParam("apiKey","A-Valid-API-Key-For-Target-Site");
$response = $request->send();
if($response->getErrorCode()==0)
{
echo "Success";
}
else
{
echo ("Uh-oh, we got the following error: " . $response->getErrorMessage());
error_log($response->getLog());
}
?>
```
--------------------------------
### Retrieve SDK Configuration Response Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/ee51584c371945a799d4f7d9cbeb77e1.html
Example JSON response showing the structure of supported SDK types and their respective versions.
```json
{
"callId": "26254b038410468bb5a3a344134fd88b",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2018-12-11T12:52:24.250Z",
"result": {
{
"type": "ios_swift",
"displayName": "IOS",
"supportedVersions":
[
"1.5.1",
"1.5.0",
"1.4.1"
]
},
{
"type": "js",
"displayName": "Web SDK"
}
}
```
--------------------------------
### Get Countries List - REST API Response Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/40e8d65874d4480eb1ed7ff105351cbd.html?locale=en-US&state=PRODUCTION&version=SHIP
This JSON structure represents a successful response from the accounts.address.countries.get API, containing a list of countries with their names and ISO codes.
```json
{
"callId": "26254b038410468bb5a3a344134fd88b",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2018-12-11T12:52:24.250Z"
"countries": [
{"name": "Andorra",
"isoCode2": "AD",
"isoCode3": "AND",
"numericCode": "020"
},
{
"name": "United Arab Emirates",
"isoCode2": "AE",
"isoCode3": "ARE",
"numericCode": "764"
}
]
}
```
--------------------------------
### HashBinaryFormat Configuration Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/41365a5370b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Example configuration for the HashBinaryFormat parameter used during account imports to handle specific password and salt encodings.
```text
HashBinaryFormat="$0x4769677961$salt:base64$0x5F$password:utf16$0x4769677961 HashSalt=""
```
--------------------------------
### Complete Authorization Implementation Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/09a37f7d070c493a8fc7500dc0ccf042.html?locale=en-US&state=PRODUCTION&version=SHIP
A full HTML page example including both delegated admin and authorization retrieval functionality.
```html
Mobile Ready Screen-Set Implementation Example
Organization Registration
Login
Delegated Admin Console
Show Authorization
Logout
```
--------------------------------
### Get Group Schema JavaScript Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/099c766d87174cb79ec9a56ca5621acb.html
Use this JavaScript code to call the accounts.groups.getSchema API and display the response. Ensure the callback function is defined to handle the API result.
```javascript
function showSchemaInfo(response) {
alert(JSON.stringify(response));
}
function getSchemaInfo() {
var params = {
model: 'model',
//set up the callback to handle the response
callback: showSchemaInfo
};
gigya.accounts.groups.getSchema(params);
}
```
--------------------------------
### Get Group Info JavaScript Example
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/6052323756874c29ab69e13353bb8277.html
This JavaScript code demonstrates how to call the gigya.accounts.groups.getGroupInfo method to retrieve group details. Ensure the callback function is correctly defined to handle the response.
```javascript
function getGroupInfo(response) {
alert(JSON.stringify(response));
}
function getGroupInfo() {
var params = {
model: 'Family',
groupId: 'Smith',
//set up the callback to handle the response
callback: getGroupInfo
};
gigya.accounts.groups.getGroupInfo(params);
}
```
--------------------------------
### Get Policies using .NET SDK
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/41359a2970b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Use the .NET SDK to retrieve account policies. Ensure you have the Gigya.Socialize.SDK installed. Replace placeholder keys with your actual API and secret keys.
```.NET
using System;
using Gigya.Socialize.SDK;
class Program {
static void Main(string[] args)
{
const string apiKey = "Enter-Your-API-Key-Here";
const string secretKey = "Enter-Your-Secret-Key-Here";
string method = "accounts.getPolicies";
GSRequest request = new GSRequest(apiKey, secretKey, method, true);
request.SetParam("sections","registration,gigyaPlugins,accountOptions");
GSResponse response = request.Send();
if (response.GetErrorCode() == 0)
{
// Everything's okay
GSObject resObj = response.GetData();
// Do something with the data
}
else
{
Console.WriteLine("Uh-oh, we got the following error:{0}", response.GetLog());
}
}
}
```
--------------------------------
### Initialize Gigya SDK
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/417ab38f70b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Examples for initializing the SDK in both Objective-C and Swift, including domain configuration.
```Objective-C
[Gigya initWithAPIKey:@"PUT-YOUR-APIKEY-HERE" application:application launchOptions:launchOptions];
[Gigya initWithAPIKey:@"PUT-YOUR-APIKEY-HERE" application:application launchOptions:launchOptions APIDomain:@"eu1.gigya.com"];
```
```Swift
/*
Using default domain (us1-gigya.com).
*/
Gigya.sharedInstance().initFor(apiKey: "YOUR-API-KEY")
/*
Supplying Api-Key & Api-Domain
*/
Gigya.sharedInstance().initFor(apiKey: "YOUR-API-KEY", apiDomain: "YOUR-API-DOMAIN")
```
--------------------------------
### Java: Get Lite Token
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/413560f270b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Use this Java code to obtain a lite token for a user. Ensure you have your API key, secret key, and user key from your Gigya site setup.
```Java
class Program {
public static void main(String[] args) {
//Define the API-Key and Secret key (the keys can be obtained from your site setup page on Gigya's website).
final String apiKey = "PUT-YOUR-APIKEY-HERE";
final String secretKey = "PUT-YOUR-SECRET-KEY-HERE";
final String userKey = "PUT-YOUR-USER/APPLICATION-KEY-HERE";
String apiMethod = "accounts.getLiteToken";
GSRequest request = new GSRequest(apiKey, secretKey, apiMethod, null, true, userKey);
request.setParam("email","bob@bob.com");
request.setParam("sessionExpiration",3600);
GSResponse response = request.send();
if(response.getErrorCode()==0)
{
System.out.printIn("success!");
}
else
{
System.out.printIn("Uh-oh, we got the following error: " + response.getLog());
}
}
}
```
--------------------------------
### Sample Response for accounts.b2b.setup.bootstrap
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/0859deceb0f44a2c80dfe36d2f87f359.html?locale=en-US&state=PRODUCTION&version=SHIP
This is a sample JSON response from the accounts.b2b.setup.bootstrap API, illustrating the structure of the returned data including call ID, error code, API version, status, timestamp, and authorization workspaces.
```json
{
"callId": "70ad65c437824b18b857c8c1b7a2cc6c",
"errorCode": 0,
"apiVersion": 2,
"statusCode": 200,
"statusReason": "OK",
"time": "2023-02-20T13:10:35.617Z",
"authWorkspaces": [
```
--------------------------------
### Advanced Validation for Registration Form
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/413a5b7170b21014bbc5a10ce4041860.html
This example shows how to enforce email format (uppercase only), ensure the first name starts with a capital letter, and require the subscription checkbox to be checked. It targets the 'gigya-register-screen'.
```javascript
gigya.accounts.showScreenSet(params);
var params =
{
screenSet: 'Default-RegistrationLogin',
containerID: 'RAASLogin',
customLang: {
email_already_exists: 'You already have an account'
},
onBeforeValidation: event => {
if (event.screen === "gigya-register-screen"){
var errors = [
{
"email": "Lowercase characters not allowed",
"form":"Please check your email"
},
{
"firstName": "First name start with capital letters",
"form":"Please check your first name"
},
{
"data.subscribe": true,
"form":"Please check your subscription"
}
];
if(event.formData.email && event.formData.email !== event.formData.email.toUpperCase())
return errors[0];
if(event.formData["profile.firstName"].substr(0, 1) !== event.formData["profile.firstName"].toUpperCase().substr(0, 1))
return errors[1];
if(!event.formData["data.subscribe"])
return errors[2];
}
}
}
gigya.accounts.showScreenSet(params);
```
--------------------------------
### Working Examples
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/41532ab870b21014bbc5a10ce4041860.html?locale=en-US&state=PRODUCTION&version=SHIP
Explore interactive examples to see event handlers in action and obtain the relevant code.
```APIDOC
### Working Example
Please explore the following pages, where you may activate full working examples and then grab the code:
* The "Login" Example - the example uses the `_onLogin` event.
* The "Get User Information" Example - the example uses the `onConnectionAdded` and `onConnectionRemoved` events.
```
--------------------------------
### Get B2B User Assets with Python SDK
Source: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/ad1f49cb03ff4ae39db4bf7f86211890.html?locale=en-US&state=PRODUCTION&version=SHIP
This Python example demonstrates how to use the Gigya SDK to fetch assets for a B2B user. It involves defining the request parameters and handling the response.
```python
from GSSDK import *
# Define the API and Secret key (the keys can be obtained from your site setup page in the Gigya console).
apiKey = "PUT-YOUR-APIKEY-HERE"
secretKey = "PUT-YOUR-SECRET-KEY-HERE"
# Step 1 - Defining the request and adding parameters
method = "accounts.b2b.auth.getAssets"
params = {
"bpid":"udiauoaisudoi892139873",
"appid":"b22398839280r",
"UID":"The_User_UID",
"clientContext":"{clientIP: \"The user's IP address\"}"
}
request = new GSRequest(apiKey,secretKey,method,params)
# Step 2 - Sending the request
response = request.send()
# Step 3 - handling the request's response.
if (response.getErrorCode()==0):
# SUCCESS! response status = OK
print "Success in accounts.b2b.auth.getAssets operation."
else:
# Error
print "Got error on accounts.b2b.auth.getAssets: " + response.getErrorMessage()
# You may also log the response: response.getLog()
```