file upload via API for MFT

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值