Quickstart
This guide will show you how to connect to the Galileo API and send a POST request to the Ping endpoint using cURL, Python, and the Postman API development platform. Make sure you have your Sandbox credentials before you begin (see Sandbox environment in the Environments guide).
After you finish the quickstart, make sure to see Build a Sample App, where you will learn how to create a sample account, deposit funds, and send requests to a few common endpoints.
Note
Galileo filters IP addresses that are outside of the United States. If your access is restricted, contact a Galileo representative for assistance.
cURL
cURL is a terminal tool that enables HTTP requests. It is installed on most computers, so setup should be minimal.
Note
To check if you have cURL, open the terminal and run the command,
curl -V
. If you have cURL, you should see a version number. If you donβt have it, you can download it here: https://curl.haxx.se/download.html.
Follow these steps to send a POST request to the Ping endpoint using cURL:
- Open the terminal.
- Using the terminal, navigate to the folder containing your client certificate downloaded from the Sandbox Dashboard.
- Run the script below, replacing values with your credentials for:
apiLogin
apiTransKey
providerId
transactionId
β This can be any random string but must be unique for each request.
curl --location --request POST 'https://sandbox-api.gpsrv.com/intserv/4.0/ping' \
--header 'response-content-type: json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'apiLogin=0000' \
--data-urlencode 'apiTransKey=1111' \
--data-urlencode 'providerId=9999' \
--data-urlencode 'transactionId=c6285802-72e4-4760-9011-b39993ecfbd5'
curl --location --request POST "https://sandbox-api.gpsrv.com/intserv/4.0/ping" ^
--header "response-content-type: json" ^
--header "Content-Type: application/x-www-form-urlencoded" ^
--data-urlencode "apiLogin=0000" ^
--data-urlencode "apiTransKey=1111" ^
--data-urlencode "providerId=9999" ^
--data-urlencode "transactionId=c6285802-72e4-4760-9011-b39993ecfbd5"
Note
If you are accessing the CV or Production environment, replace the Sandbox URL and credentials with the URL and credentials that you received from your Galileo representative.
- Check the output. A successful ping will return
"status_code":0,"status":"Success"
.
Python
You can also use Python to make API requests in the Sandbox environment.
Python setup
To get started with Python:
- If you don't have it, you can download Python here: https://www.python.org/.
- When Python is installed, open the terminal.
- In the terminal, run one of the following commands to install the
requests
module:- Mac OS/Linux β
python -m pip install requests
- Windows β
py -m pip install requests
- Mac OS/Linux β
- Check the output. You should see a message indicating that the module was successfully installed.
Using Python from the terminal
Follow these steps to send a POST request to the Ping endpoint using Python from the terminal:
- Open the terminal.
- Using the terminal, navigate to the directory containing the client certificate you downloaded from the Sandbox Dashboard.
- At the prompt, run the command,
python
. - At the Python prompt, run the script below, replacing values with your Sandbox credentials for:
apiLogin
apiTransKey
providerId
cert
β Input the file name of your certificate (.pem file).
import requests
from xml.dom.minidom import parseString
import uuid
payload = {'apiLogin':'0000', 'apiTransKey':'1111', 'providerId':'9999', 'transactionId':uuid.uuid4()}
r = requests.post('https://sandbox-api.gpsrv.com/intserv/4.0/ping', data=payload, cert='abcd777.pem')
dom = parseString(r.text)
statusCode = dom.getElementsByTagName('status_code')
print('ping response code=' + statusCode[0].firstChild.nodeValue)
Note
If you are accessing the CV or Production environment, replace the Sandbox URL and credentials with the URL and credentials that you received from your Galileo representative
- Check the output. A successful ping returns
ping response code=0
.
Using a Python file
To work from a file instead of directly in the terminal:
- Paste the code above into a plain text file.
- Save the file with the extension
.py
(for example,test-ping.py
). The file should be in the same folder as your client certificate (.pem
file). - Open the terminal and navigate to the directory containing your client certificate and
.py
file. - Run
python test-ping.py
- Check the output. A successful ping returns
ping response code=0
.
Postman
Galileo has created a collection for the Postman API client. See Postman Setup for setup instructions and a tutorial for sending a POST request to the Ping endpoint.
Updated 5 months ago