curl -X POST -k -u user:password -H "Accept: application/json" -F "upload=@testFile.txt" https://server/api/v1.4/files
will upload the file called testFile.txt from the current folder into the home folder of the user with name user.
if you need to do a subfolder, you add it at the end of the path:
curl -X POST -k -u user:password -H "Accept: application/json" -F "upload=@testFile.txt" https://server/api/v1.4/files/folder
Now, if you want to do some fancier things, it can get interesting. For example:
curl -X PUT -k -u user:password -H "Accept: application/json" -F "upload=@testFile.txt" https://server/api/v1.4/files/annie.txt?transferMode=ASCII
Will upload the file testFile.txt to the main folder and use the name annie.txt and use ASCII mode.
curl -X PUT -k -u user:password -H "Accept: application/json" -F "upload=@testFile.txt" https://server/api/v1.4/files/folder/annie.txt?transferMode=BINARY
will do the same but in BINARY mode and in the folder "folder" under the account home folder.
1. List Account details such as Account Name, Login Name, Account Type, Current Home path:
Please replace the following values accordingly
admin_account - login name of the admin account
admin_pass - password for the admin account
IP_or_hostname - the corresponding IP or hostname of the ST instance
admin_port - port for the admin UI
AN - Account Name
curl -k -u admin:admin -X GET -H "Content-Type: application/xml" -H "Accept: application/xml" https://ip_or_hostname:admin_port/api/v1.4/accounts/AN
2. List all certificates for an account:
curl -k -u admin:admin -X GET -H "Content-Type: application/xml" -H "Accept: application/xml" https://IP_or_hostname:admin_port/api/v1.4/certificates?account=AN
3. List all transfer sites and subscriptions for an account:
curl -k -u admin_account:admin_pass -X GET -H "Content-Type: application/xml" -H "Accept: application/xml" https://IP_or_hostname:admin_port/api/v1.4/subscriptions?account=AN
curl -k -u admin_account:admin_pass -X GET -H "Content-Type: application/xml" -H "Accept: application/xml" https://IP_or_hostname:admin_port/api/v1.4/sites?account=AN
And some articles which may also come in handy:
https://support.axway.com/en/articles/article-details/id/177604
https://support.axway.com/en/articles/article-details/id/177568
https://support.axway.com/en/articles/article-details/id/177563
https://servername/api/v1.4/docs/index.html
If you try upload of file operation, it will print the curl command.
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: text/html' 'https://servername/api/v1.4/files?transferMode=BINARY'
you can use -k and -u switch along with it