Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to write key-value pair data to a specified namespace and supports setting expiration time. If the key already exists, it overwrites the original value. If Not Exist, it creates a new key-value pair.
A maximum of 20 requests can be initiated per second for this API.
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: EdgeKVPut. |
| Version | Yes | String | Common Params. The value used for this API: 2022-09-01. |
| Region | No | String | Common Params. This parameter is not required. |
| ZoneId | Yes | String | Zone ID. |
| Namespace | Yes | String | Namespace name. |
| Key | Yes | String | Key name, with a length of 1-512 characters, supports valid UTF-8 characters. |
| Value | Yes | String | Key-value. Cannot be empty and supports up to 1 MB. Supports storing string data. |
| Expiration | No | Integer | Expiry date of the key-value pair, absolute time in seconds, represents the seconds elapsed since 00:00:00 on January 1, 1970 (UTC) (Unix timestamp). The value must be greater than or equal to current time + 60, meaning the expiry date is at least 60 seconds from now. When both Expiration and ExpirationTTL are filled, ExpirationTTL takes precedence. If left empty, the key-value pair will never expire. |
| ExpirationTTL | No | Integer | The survival time of the key-value pair is a relative time in seconds, indicating that the data will expire after transit of specified seconds. Value ranges from 60. When both Expiration and ExpirationTTL are filled, ExpirationTTL takes precedence; if left empty, the key-value pair will never expire. |
| 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. |
Write a key-value pair with key named hello and value world to namespace ns-011 of site zone-3j1xw7910arp, with expiry timestamp 1774513200 and TTL 3600 seconds.
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: EdgeKVPut
<Common request parameters>
{
"ZoneId": "zone-3j1xw7910arp",
"Namespace": "ns-011",
"Key": "hello",
"Value": "world",
"Expiration": 1774513200,
"ExpirationTTL": 3600
}
{
"Response": {
"RequestId": "5fc4b004-890f-44dc-9c88-e6addd1cf146"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
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 | Operation failed. |
| ResourceUnavailable.NamespaceNotFound | KV namespace does not exist. |
フィードバック