Skip to content

1.1 Class GSRequest Python

Levi edited this page Jun 11, 2026 · 3 revisions

Description

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

Constructor Summary

Constructor Description
GSRequest(string apiKey=None,
string secretKey=None,
string apiMethod=None,
JSON params=None,
Boolean useHTTPS=False,
userKey=None)
Constructs a request using the following parameters:
  • apiKey - Your Gigya API-Key which can be obtained from the DashboardInformation published on non-SAP site section on Gigya's website (Read more in the Site Selector documentation).
  • secretKey - Your Gigya Secret-Key which can be obtained from the DashboardInformation published on non-SAP site section on Gigya's website (Read more in the Site Selector 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, 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 string buildQS(JSON params) Converts a params dictionary to a sorted query string.
JSON object getParams() Returns the 'params' field of the request.
GSResponse send(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).
void setParam(string param, val) Sets a request parameter with a value. The val parameter can be of any type.
static string UrlEncode(string value) Applies URL encoding rules to the parameter string, and returns the outcome.
void setProxy(string proxy) The IP address or domain of the proxy through which this request will be sent.
void setAPIDomain(string apiDomain=None) Sets the data center domain used for making API calls. This method provides the option to override the default domain "us1.gigya.com" and specify an alternative data center to be used. Value:
  • apiDomain (mandatory) - The data center domain to be used.
    For example:
    setAPIDomain("<Data_Center>")
If you are not sure of your site's data center, see Finding Your Data Center.

.

Clone this wiki locally