Some interfaces may need to upload files. The Pyvio unified file processing mode is as follows:
The developer first uploads the file to Pyvio Sftp.
Call the File Upload
API to obtain the file of the uploaded file_id, file_id is used as a parameter for other business APIs.
The file type can only be .xls,.xlsx,.doc,.docx,.pdf,.jpg,.jpeg,.png,bmp,.zip,.rar.
/{appId}/INPUT/{bizType}/{yyyyMMdd}/{unitId}
Example Request
curl --location --request POST '{$base_url}/file/api/v1/upload' \
--header 'Request-Id: bcaaf79e-71f3-3abf-f719-4449143c' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2Nlc3NUb2tlbkV4cGlyZWQiOjE2NjM3MzQ2MjI1MDQsImFwcElkIjoiMTU2OTY0MTI3MDk1MzU4OTUwNCIsInNjb3BlIjoidXNlcl9yZWFkIiwidW5pdElkIjoiMTExIiwidG9rZW5Vbml0SWQiOiJVVDIyMDkwMjE1NzAwMTU2IiwiZ3JhbnRUeXBlIjoiYXV0aG9yaXphdGlvbl9jb2RlIn0.PuwMj5s4ljygYDoIvS_gNfriZDwUY0a7Zhrn0_zxU-4' \
--header 'Sign: DGhen+ndwMlmkTElnzyMlVa+H/YYG/UEF3uqFpgTVhEPEmApDPiqOyZQle6h/NmT39AO3KmQEjIRJuvXx5SzQtw6iYXbkdLX42SffNfjY/VOggcj2u6SGGyNoZbpm/Ttuux5Z48SUK0wnkvcSD8ht4luI++/iy5gnUHgM2AOHtQ=' \
--header 'X-Timestamp: 1666332361000' \
--header 'X-Unit-Id: UT1675766643661405569' \
--header 'Content-Type: application/json' \
--data-raw '{
"path":"/1674044218623168131/INPUT/User/20230706/UT1675766643661405569/1676508902616727552.jpg"
}'
Example Response
{
"code": "SUCCESS",
"message": null,
"data":{
"file_id":"9379af064426472ca7522d6e773df4a9"
}
}