Class GSRequest Python

Skip to end of metadata
Go to start of metadata

 

Description

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

 

Constructor Summary

ConstructorDescription
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 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 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. Parameter: 
  • apiDomain (mandatory) - the domain of the data center to be used. For example: "eu1.gigya.com" for Europe data center or "au1.gigya.com" for Australia data center .

 

Clients with sites defined under Gigya's European data center should replace domain references to "us1.gigya.com" with "eu1.gigya.com". To verify site location see Finding Your Data Center.