Method: providers.tasks.create
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo và trả về một đối tượng Task
mới.
Yêu cầu HTTP
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
parent |
string
Bắt buộc. Phải ở định dạng providers/{provider} . provider phải là mã dự án trên Google Cloud. Ví dụ: sample-cloud-project .
|
Tham số truy vấn
Thông số |
header |
object (DeliveryRequestHeader )
Không bắt buộc. Tiêu đề của yêu cầu API phân phối chuẩn.
|
taskId |
string
Bắt buộc. Mã việc cần làm phải là mã duy nhất, nhưng không được là mã theo dõi quá trình vận chuyển. Để lưu trữ mã theo dõi gói hàng, hãy sử dụng trường trackingId . Lưu ý rằng nhiều tác vụ có thể có cùng trackingId . Mã việc cần làm phải tuân theo các quy định hạn chế sau:
- Phải là một chuỗi Unicode hợp lệ.
- Giới hạn độ dài tối đa là 64 ký tự.
- Được chuẩn hóa theo Biểu mẫu chuẩn hóa Unicode C.
- Không được chứa bất kỳ ký tự ASCII nào sau đây: '/', ':', '?', ',' hoặc '#'.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của Task
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một thực thể mới tạo của Task
.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eCreates and returns a new \u003ccode\u003eTask\u003c/code\u003e object via a \u003ccode\u003ePOST\u003c/code\u003e request to the specified URL.\u003c/p\u003e\n"],["\u003cp\u003eRequires a \u003ccode\u003eprovider\u003c/code\u003e path parameter which should be set to your Google Cloud Project ID.\u003c/p\u003e\n"],["\u003cp\u003eRequires a unique \u003ccode\u003etaskId\u003c/code\u003e query parameter and optionally accepts a \u003ccode\u003eheader\u003c/code\u003e for the Delivery API request.\u003c/p\u003e\n"],["\u003cp\u003eThe request body and successful response body both contain an instance of \u003ccode\u003eTask\u003c/code\u003e object, detailed further in provided documentation links.\u003c/p\u003e\n"]]],[],null,["# Method: providers.tasks.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n\nCreates and returns a new `Task` object.\n\n### HTTP request\n\n`POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. Must be in the format `providers/{provider}`. The `provider` must be the Google Cloud Project ID. For example, `sample-cloud-project`. |\n\n### Query parameters\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `header` | `object (`[DeliveryRequestHeader](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/DeliveryRequestHeader)`)` Optional. The standard Delivery API request header. |\n| `taskId` | `string` Required. The Task ID must be unique, but it should be not a shipment tracking ID. To store a shipment tracking ID, use the `trackingId` field. Note that multiple tasks can have the same `trackingId`. Task IDs are subject to the following restrictions: - Must be a valid Unicode string. - Limited to a maximum length of 64 characters. - Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/). - May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'. |\n\n### Request body\n\nThe request body contains an instance of [Task](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks#Task).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Task](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks#Task)."]]