Skip to main content

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}
ParameterTypeRequired/OptionalDescription
appidStringRequiredThe App ID of the project. You can get it through one of the following methods:
  • Copy from the Agora Console.
  • Call the Get all projects API, and read the value of the vendor_key field in the response body.
  • idNumberRequiredThe ID of the rule that you want to update.
    timeNumberRequiredThe time duration (in minutes) to ban the user. The value range is [1,1440].

    Note

  • If the set value is between 0 and 1, Agora automatically sets the value to 1.
  • If the set value is greater than 1440, Agora automatically sets the value to 1440.
  • If the set value is 0, the banning rule does not take effect. The server sets all users that conform to the rule offline, and users can log in again to rejoin the channel.
  • Use either time or time_in_seconds. If you set both parameters, the time_in_seconds parameter takes effect; if you set neither of these parameters, the Agora server automatically sets the banning time duration to 60 minutes, that is, 3600 seconds.
  • time_in_secondsNumberRequiredThe time duration (in seconds) to ban the user. The value range is [10,86430].

    Note

  • If the set value is between 0 and 10, Agora automatically sets the value to 10.
  • If the set value is greater than 86430, Agora automatically sets the value to 86430.
  • If the set value is 0, the banning rule does not take effect. The server sets all users that conform to the rule offline, and users can log in again to rejoin the channel.
  • Use either time or time_in_seconds. If you set both parameters, the time_in_seconds parameter takes effect; if you set neither of these parameters, the Agora server automatically sets the banning time duration to 60 minutes, that is, 3600 seconds.
  • Request examples

    Test this request in Postman or use one of the following code examples:

    Sample request:

    curl --request PUT \
    --url http://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
    }'

    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:

    ParameterTypeDescription
    statusStringThe status of this request. success means the request succeeds.
    resultObjectThe result of the update:
  • id: String. The rule ID.
  • ts: String. The UTC time when the rule expires.
  • Response example

    The following is a response example for a successful request:

    {  "status": "success",  "result": {    "id": 1953,    "ts": "2018-01-09T08:45:54.545Z"  }}

    Video Calling