1. API Description
Domain name for API request: pts.intl.tencentcloudapi.com.
This API is used to create a file.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name |
Required |
Type |
Description |
| Action |
Yes |
String |
Common Params. The value used for this API: CreateFile. |
| Version |
Yes |
String |
Common Params. The value used for this API: 2021-07-28. |
| Region |
No |
String |
Common Params. This parameter is not required for this API. |
| FileId |
Yes |
String |
File ID. Its value should be the corresponding directory of the file in the COS bucket after it has been uploaded in the previous step. |
| ProjectId |
Yes |
String |
Project ID. |
| Kind |
Yes |
Integer |
File type. 1 represents parameter file, 2 represents protocol file, 3 represents request file. |
| Name |
Yes |
String |
Filename. |
| Size |
Yes |
Integer |
File size. |
| Type |
Yes |
String |
File type. The 'folder' represents a folder; if not specified, it represents a file. |
| LineCount |
No |
Integer |
Number of Rows. |
| HeadLines.N |
No |
Array of String |
First few rows of file. |
| TailLines.N |
No |
Array of String |
Last few rows of file. |
| HeaderInFile |
No |
Boolean |
Whether the header is in the file. |
| HeaderColumns.N |
No |
Array of String |
Header. |
| FileInfos.N |
No |
Array of FileInfo |
Files in the folder. |
3. Output Parameters
| Parameter Name |
Type |
Description |
| RequestId |
String |
The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
4. Example
Example1 Creates a file
POST / HTTP/1.1
Host: pts.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateFile
<Common request parameters>
{
"FileId": "file-235c3000",
"ProjectId": "project-btksohr0",
"Kind": 1,
"Name": "abc.csv",
"Size": 100,
"Type": "csv",
"LineCount": 10,
"HeadLines": [
"abc"
],
"TailLines": [
"abc"
],
"HeaderInFile": true,
"HeaderColumns": [
"abc"
],
"FileInfos": [
{
"Name": "abc",
"Size": 0,
"Type": "abc",
"UpdatedAt": "2020-09-22T00:00:00+00:00",
"FileId": "abc"
}
]
}
Output Example
{
"Response": {
"RequestId": "70805f6a-d7e1-4247-9d5a-fde3afe2b377"
}
}
5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
Command Line Interface
6. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code |
Description |
| FailedOperation.DbRecordCreateFailed |
Failed to create database record. |