SAP Customer Data Cloud Positions

Class GSRequest Python

Skip to end of metadata
Go to start of metadata



This class is used for sending a request to Gigya Service.


Constructor Summary

GSRequest(string apiKey=None,
                     string secretKey=None,
                     string apiMethod=None,
                     JSON params = None,
                     Boolean useHTTPS = False,
Constructs a request using the following parameters:
  • apiKey - Your Gigya API-Key which can be obtained from the Dashboard section on Gigya's website (Read more in the Site Setup documentation).
  • secretKey - Your Gigya Secret-Key which can be obtained from the Dashboard section on Gigya's website (Read more in the Site Setup documentation).
  • apiMethod - The Gigya API method to call, including namespace. For example: 'socialize.getUserInfo'. Please refer to the REST API reference for the list of available methods.
  • params (optional) - A JSON object that contains the parameters for the Gigya API method to call. Please refer to the REST API reference and find in the specific method reference the list of method parameters.
  • useHTTPS (optional) - If you wish to send the request to Gigya using HTTPS, please set this parameter to TRUE. By default the request is sent using HTTP.
  • userKey (optional) - A key of an admin user with extra permissions. If this parameter is provided, then the secretKey parameter is assumed to be the admin user's secret key and not the site's secret key.

Note: you may pass an OAuth 2.0 access_token instead of passing APIKey+SecretKey. Pass the access_token as the first parameter (instead APIKey) and None as the second (instead secretKey). Learn more about OAuth 2.0 and how to receive an access_token here.


Method Summary

Method Description
static stringbuildQS(JSON params)Converts a params dictionary to a sorted query string.
JSON objectgetParams()Returns the 'params' field of the request.
GSResponsesend(integer timeout=None)Sends the request synchronously. The method returns a GSResponse object which represents Gigya's response. Parameter:
  • timeout (optional) - Set a timeout to this request. The timeout is the number of seconds until a timeout response is returned. If the timeout expires, the server will return a response with a "Request Timeout" error (error code 504002).
voidsetParam(string param, val)Sets a request parameter with a value. The val parameter can be of any type.
static stringUrlEncode(string value)Applies URL encoding rules to the parameter string, and returns the outcome.
voidsetProxy(string proxy)The IP address or domain of the proxy through which this request will be sent.
voidsetAPIDomain(string apiDomain=None)Sets the data center domain used for making API calls. This method provides the option to override the default domain "" and specify an alternative data center to be used. Value: 
  • apiDomain (mandatory) - The data center domain to be used. For example:


    Where <Data_Center> is:
    • - For the US data center.
    • - For the European data center.
    • - For the Australian data center.
    • - For the Russian data center.
    • - For the Chinese data center.

    If you are not sure of your site's data center, see Finding Your Data Center.