KB Article #182805
RESTAPI: Obtain all Transfer Sites with password authentication
Problem
If you try to obtain the Transfer Sites in your SecureTransport, using an REST API request with the parameter usePassword
set to true, you may not receive all Transfer Sites which have this parameter.
In earlier updates of SecureTransport 5.5 Transfer Sites were created with true or false values for the usePassword
field. In more recent updates of SecureTransport 5.5 the Transfer Sites are created with values 1 and 0 respectively.
When the Sites were created in an older version of ST, and then it was upgraded to a more recent update level, the API request using the usePassword
parameter set to true will not obtain the new Sites created in the upgraded ST.
Resolution
To obtain all Transfer Sites that use password authentication, 2 API requests will have to be executed:
For Transfer Sites created with usePassword
value of 1:
curl -k -u ADMINUSER:ADMINPASS -X 'GET' 'https://ST_HOSTNAME_OR_IP:ADMIN_PORT/api/v2.0/sites?usePassword=1' -H 'accept: application/json'
For older Transfer sites created with usePassword
value of true:
curl -k -u ADMINUSER:ADMINPASS -X 'GET' 'https://ST_HOSTNAME_OR_IP:ADMIN_PORT/api/v2.0/sites?usePassword=true' -H 'accept: application/json'
The same approach would apply for the Transfer Sites that do not use password authentication:
For Transfer sites created with usePassword
value of 0:
curl -k -u ADMINUSER:ADMINPASS -X 'GET' 'https://ST_HOSTNAME_OR_IP:ADMIN_PORT/api/v2.0/sites?usePassword=0' -H 'accept: application/json'
For older Transfer sites created with usePassword
value of false:
curl -k -u ADMINUSER:ADMINPASS -X 'GET' 'https://ST_HOSTNAME_OR_IP:ADMIN_PORT/api/v2.0/sites?usePassword=false' -H 'accept: application/json'
In the above commands replace:
ADMINUSER:ADMINPASS
with the proper admin credentials
ST_HOSTNAME_OR_IP
with the hotname or IP of SecureTransport
ADMIN_PORT
with the port, on which the ST's admin service runs on