Update expiration time
This method updates the expiration time of a specified banning rule.
Prototype
- Method: PUT
- Endpoint: https://api.agora.io/dev/v1/kicking-rule
Request parameters
Request header
The Content-Type field in all HTTP request headers is application/json. All requests and responses are in JSON format. All request URLs and request bodies are case-sensitive.
The Agora Channel Management RESTful APIs only support HTTPS. Before sending HTTP requests, you must generate a Base64-encoded credential with the Customer ID and Customer Secret provided by Agora, and pass the credential to the Authorization field in the HTTP request header. See RESTful authentication for details.
Request body
Pass in the following parameters in the request body:
{  "appid": "4855xxxxxxxxxxxxxxxxxxxxxxxxeae2",  "id": 1953,  "time": 60}| Parameter | Type | Required/Optional | Description | 
|---|---|---|---|
| appid | String | Required | The App ID of the project. You can get it through one of the following methods: 
 | 
| id | Number | Required | The ID of the rule that you want to update. | 
| time | Number | Required | The time duration (in minutes) to ban the user. The value range is [1,1440]. 
 | 
| time_in_seconds | Number | Required | The time duration (in seconds) to ban the user. The value range is [10,86430]. 
 | 
Request examples
Test this request in Postman or use one of the following code examples:
- Curl
- Node.js
- Python
curl --request PUT \
    --url https://api.sd-rtn.com/dev/v1/kicking-rule \
    --header 'Accept: application/json' \
    --header 'Authorization: ' \
    --header 'Content-Type: application/json' \
    --data '{
    "appid": "4855xxxxxxxxxxxxxxxxxxxxxxxxeae2",
    "id": 1953,
    "time": 60
  }'
const http = require('http');
const options = {
  method: 'PUT',
  hostname: 'api.sd-rtn.com',
  port: null,
  path: '/dev/v1/kicking-rule',
  headers: {
    Authorization: '',
    'Content-Type': 'application/json',
    Accept: 'application/json'
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on('data', function (chunk) {
    chunks.push(chunk);
  });
  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.write(JSON.stringify({appid: '4855xxxxxxxxxxxxxxxxxxxxxxxxeae2', id: 1953, time: 60}));
req.end();
import http.client
conn = http.client.HTTPConnection("api.sd-rtn.com")
payload = "{
  "appid": "4855xxxxxxxxxxxxxxxxxxxxxxxxeae2",
  "id": 1953,
  "time": 60
}"
headers = {
    'Authorization': "",
    'Content-Type': "application/json",
    'Accept': "application/json"
}
conn.request("PUT", "/dev/v1/kicking-rule", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response parameters
For details about possible response status codes, see Response status codes.
If the status code is not 200, the request fails. See the message field in the response body for the reason for this failure.
If the status code is 200, the request succeeds, and the response body includes the following parameters:
| Parameter | Type | Description | 
|---|---|---|
| status | String | The status of this request. successmeans the request succeeds. | 
| result | Object | The result of the update: 
 | 
Response example
The following is a response example for a successful request:
{  "status": "success",  "result": {    "id": 1953,    "ts": "2018-01-09T08:45:54.545Z"  }}