This guide explains how to start using the SCAYLE API. First you need to obtain the DSID session cookie, and then you will have to generate your authentication token. Once authenticated, you can start interacting with the API using the tools and libraries described below.
Access to internal services requires prior authentication on the SCAYLE VPN via Ivanti Pulse Secure. Use the following script to sign in:
When running the script you will need to enter:
python3 login.py
The script will save the DSID cookie in the ~/.ivanti_dsid file. From then on, any request or script can reuse it. Define the environment variable as follows:
DSID=$(cat ~/.ivanti_dsid)
From the command line, run the following curl request:
curl -X POST 'https://extranet.scayle.es:11010/api/v1/auths/ldap' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Cookie: DSID=${DSID}" \
-d '{
"user": "SCAYLE_user",
"password": "SCAYLE_password"
}' | grep -oP '"token":"\K[^"]+'
Copy the token value. You will need it in the Authorization header to authenticate all your subsequent requests to the API. Define the environment variable as follows:
TOKEN=YOUR_TOKEN_HERE
Run the following curl request:
curl -X GET \
'https://extranet.scayle.es:11010/api/models' \
-H "Cookie: DSID=${DSID}; token=${TOKEN}" | grep -oP '"preset":true,"info":\{"id":"\K[^"]+'
You will receive a list with the ID of each model, which you can use later to interact with the model.
You can now use the following ways of interacting with it, or use other external ones.
Available ways to interact with the API: