Skip to main content

Provision your extension

When your extension is activated or deactivated on Agora Console, Agora passes relevant information to you so that you can take corresponding actions. For this purpose, you need to implement the provisioning API and provide the URLs to Agora.

This page provides a detailed description of the provisioning API.

Requirements

Before implementing the provisioning API, ensure that your server meets the following requirements:

  • Able to handle at least 100 requests per second.
  • Follows the standards of HTTP request and response.

Agora waits for 500 milliseconds after sending a request to your server. If there is no response, Agora resends the request for a maximum of two times.

Create an account

When a user activates your extension, Agora calls this method to pass the basic information of this user to you. You can manage users by forming a user information mapping for services such as usage query.

HTTP request

URL


_1
POST https://{host}/customers/new

Request body The request body contains the following fields:

FieldRequired/OptionalTypeData lengthDescription
planIdRequiredString16The billing plan that the user selects.
customerNameOptionalString32The company name of the user.
customerIdRequiredStringN/AThe account ID of the user on Agora Console.
customerEmailOptionalString32The email address of the user.
customerPhoneOptionalString32The phone number of the user.
apiKeyRequiredString32The API key, used for authentication between you and Agora. You need to generate your own API key and provide it to Agora.
signatureRequiredStringN/AThe signature generated by the signature algorithm. You need to deploy the algorithm to verify that the request is sent by Agora.

HTTP response

The response body contains the following fields:

FieldTypeDescription
statusStringThe status of the request:
  • success: The request succeeds.
  • failed: The request fails.
  • statusReasonStringThe reason why the request succeeds or fails.

    Example

    Request body


    _9
    {
    _9
    "planId": "ABC",
    _9
    "customerName": "AgoraCustomerA",
    _9
    "customerId": "12345678910",
    _9
    "customerEmail": "AgoraCustomerA",
    _9
    "customerPhone": "12345678910",
    _9
    "apiKey": "pz**************************gd",
    _9
    "signature": "Q7**************************xM"
    _9
    }

    Response body


    _4
    {
    _4
    "status": "success",
    _4
    "statusReason": ""
    _4
    }

    Create a project

    When a user enables your extension for an Agora project, Agora calls this method to pass the project information to you.

    HTTP request

    URL


    _1
    POST https://{host}/customers/{customerId}/projects/new

    Path parameter

    customerId: String. The account ID of the user on Agora Console.

    Request body The request body contains the following fields:

    FieldRequired/OptionalTypeData lengthDescription
    projectIdRequiredIntN/AThe ID of the Agora project. A user could enable your extension for multiple projects, which means one customerId could be mapped to multiple projectIds.
    apiKeyRequiredString32The API key, used for authentication between you and Agora. You need to generate your own API key and provide it to Agora.
    signatureRequiredStringN/AThe signature generated by the signature algorithm. You need to deploy the algorithm to verify that the request is sent by Agora.

    HTTP response

    The response body contains the following fields:

    FieldTypeDescription
    statusStringThe status of the request:
  • success: The request succeeds.
  • failed: The request fails.
  • statusReasonStringThe reason why the request succeeds or fails.
    dataObjectThis object includes the following properties:
  • appKey: String (32–255 bytes). The app key of the project. You use this field to authenticate the user.
  • appSecret: String (32–255 bytes). The app secret of the project. You use this field to authenticate the user.
  • licenseUrl: (Optional) String. The license file for authorizing your extension to users. This field applies only if you charge your extension with license files.
  • Example

    Request body


    _5
    {
    _5
    "projectId": 5****8,
    _5
    "apiKey": "pz**************************gd",
    _5
    "signature": "Q7**************************xM"
    _5
    }

    Response body


    _9
    {
    _9
    "status": "success",
    _9
    "statusReason": "",
    _9
    "data": {
    _9
    "appKey": "cf**************************yb",
    _9
    "appSecret": "NW**************************M=",
    _9
    "licenseUrl": "https://*********"
    _9
    }
    _9
    }

    Deactivate the account

    Once the user deactivates your extension on Agora Console, Agora calls this method to notify you to delete the user's account and stop providing any relevant service.

    HTTP request

    URL


    _1
    PUT http://{host}/customers/{customerId}/deactivate

    Path parameter customerId: String. The ID of the user on Agora Console.

    Request body The request body contains the following fields:

    FieldRequired/OptionalTypeData lengthDescription
    apiKeyRequiredString32The API key of the vendor, used for authentication between Agora and the vendor. You need to generate your own API key and provide it to Agora.
    signatureRequiredStringN/AThe signature generated by the signature algorithm. You need to deploy the algorithm to verify that the request is sent by Agora.

    HTTP response

    The response body contains the following fields:

    FieldTypeDescription
    statusStringThe status of the request:
  • success: The request succeeds.
  • failed: The request fails.
  • statusReasonStringThe reason why the request succeeds or fails.

    Example

    Request body


    _4
    {
    _4
    "apiKey": "pz**************************gd",
    _4
    "signature": "Q7**************************xM"
    _4
    }

    Response body


    _4
    {
    _4
    "status": "success",
    _4
    "statusReason": ""
    _4
    }

    Deactivate the project

    Once the user disables your extension for an Agora project, Agora calls this method to pass the project information to you.

    HTTP request

    URL


    _1
    PUT http://{host}//customers/{customerId}/projects/{projectId}/deactivate

    Path parameter

    ParameterTypeDescription
    customerIdStringThe account ID of the user on Agora Console.
    projectIdIntThe ID of the project for which the user wants to disable your extension.

    Request body The request body contains the following fields:

    FieldRequired/OptionalTypeData lengthDescription
    apiKeyRequiredString32The API key of the vendor, used for authentication between Agora and the vendor. You need to generate your own API key and provide it to Agora.
    signatureRequiredStringN/AThe signature generated by the signature algorithm. You need to deploy the algorithm to verify that the request is sent by Agora.

    HTTP response

    The response body contains the following fields:

    FieldTypeDescription
    statusStringThe status of the request:
  • success: The request succeeds.
  • failed: The request fails.
  • statusReasonStringThe reason why the request succeeds or fails.

    Example

    Request body


    _4
    {
    _4
    "apiKey": "pz**************************gd",
    _4
    "signature": "Q7**************************xM"
    _4
    }

    Response body


    _4
    {
    _4
    "status": "success",
    _4
    "statusReason": ""
    _4
    }