Skip to content
Levi edited this page Jun 11, 2026 · 7 revisions

Description

This document is a practical step-by-step guide for programmers who wish to integrate the SAP Customer Data Cloud from Gigya service into their Python application. Follow the steps below to get started, and use the Library Reference while implementing.

This SDK currently supports:

  • Python 2.7.x and 3.x
  • Python 3.x

Library Guide

Follow these steps to integrate this library in your Python application:

Download the zip file from: Gigya Developer Downloads

The file includes the GSSDK.py and the cacert.pem files. Extract both files to the same location.

Obtain Gigya's APIKey and Secret key.

Import GSSDK.py library into your application.

Log the user in.

Use Gigya's API - Send Requests.

Optional: incorporate security measures.

Obtaining Gigya's APIKey and Secret key

Making API calls requires an API Key and a Secret Key which are obtained from the Site DashboardInformation published on non-SAP site page on the Gigya website. The Secret Key must be kept secret and never transmitted to an untrusted client or over insecure networks. The API Key and the Secret Key are required parameter in each request (further ahead in this document you will find guidance for sending requests).

Importing the GSSDK.py Library into Your Application

To get started, you'll need to import Gigya Python SDK to your application:

Copy the GSSDK.py file to your Python application path.

Import the GSSDK.py file into your application:

from GSSDK import *

You should now be able to use the SDK in your project.

Logging the User in

The first interaction with Gigya must always be logging in. If the user is not logged in, you cannot access their social profile nor perform social activities, such as setting their status. Sending requests requires an identified Gigya user (the identification of whom is performed using the UID parameter) with an active session. A user session is created when a user logs in via the Gigya service. Log users in through your client application using our Web SDK methods: socialize.login, socialize.notifyLogin, or using our ready made Social Login UI.

To learn more about the login process, see Social Login.

Sending a Request

After you have logged in the user, you may use the GSRequest class to access the user profile and perform various activities. This is implemented using GSRequest's send method. The following code sends a request to set the current user's status to "I feel great":

# Define the API-Key and Secret key (the keys can be obtained from your site setup page on Gigya's website).
apiKey = "PUT-YOUR-APIKEY-HERE"
secretKey = "PUT-YOUR-SECRET-KEY-HERE"
 
# Step 1 - Defining the request and adding parameters
method = "socialize.setStatus"
params={"uid":"PUT-UID-HERE", "status":"I feel great"}    # Set "uid" to the user's ID, and "status" to "I feel great"
request = 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 setStatus operation." 
else:
    # Error
    print "Got error on setStatus: " + response.getErrorMessage()
    # You may also log the response: response.getLog()  

Step 1: Defining the Request and Adding Parameters

Create a GSRequest instance:

method = "socialize.setStatus"
params={"uid":"PUT-UID-HERE", "status":"I feel great"}    # Set "uid" to the user's ID, and "status" to "I feel great"
request = GSRequest(apiKey,secretKey,method,params)  

The parameters of the GSRequest are:

  • apiKey
  • secretKey
  • method - the Gigya API method to call, including namespace. For example: 'socialize.getUserInfo'. Refer to REST API reference for the list of available methods.
  • params - In this case the uid and status.

Note: In the REST API reference you may find the list of available Gigya API methods and the list of parameters per each method.

Step 2: Sending the Request

Execute GSRequest's send method:

response = request.send()  

The method returns a GSResponse object, which is handled in the next step.

.

Clone this wiki locally