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).
Note
New API credentials are required after 30 days and must be generated by a team admin. If the incorrect details are used, your API request will fail and your company account will be locked.
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.
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.
- Run the script below, replacing values with your credentials for:
apiLogin
apiTransKey
transactionId
— This can be any random string but must be unique for each request.
curl --location --request POST 'https://api-sandbox.cv.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=29152' \
--data-urlencode 'transactionId=c6285802-72e4-4760-9011-b39993ecfbd5'
curl --location --request POST "https://api-sandbox.cv.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 "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.
- At the prompt, run the command,
python
. - At the Python prompt, run the script below, replacing values with your Sandbox credentials for:
apiLogin
apiTransKey
import requests
from xml.dom.minidom import parseString
import uuid
payload = {'apiLogin':'0000', 'apiTransKey':'1111', 'transactionId':uuid.uuid4()}
r = requests.post('https://api-sandbox.cv.gpsrv.com/intserv/4.0/ping', data=payload')
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
). - 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 over 1 year ago