Method: providers.tasks.create
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。必须采用 providers/{provider} 格式。provider 必须是 Google Cloud 项目 ID。例如 sample-cloud-project 。
|
查询参数
参数 |
header |
object (DeliveryRequestHeader )
可选。标准 Delivery API 请求标头。
|
taskId |
string
必需。任务 ID 必须是唯一的,但不得是配送跟踪 ID。如需存储配送跟踪 ID,请使用 trackingId 字段。请注意,多个任务可以具有相同的 trackingId 。任务 ID 存在以下限制:
- 必须是有效的 Unicode 字符串。
- 长度上限为 64 个字符。
- 根据 Unicode 标准化形式 C 进行标准化。
- 不得包含以下任何 ASCII 字符:“/”“:”“?”“,”或“#”。
|
响应正文
如果成功,响应正文将包含一个新创建的 Task
实例。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\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)."]]