Provision your extension

Updated

Provide the URLs to Agora in order to receive extension activation and deactivation information.

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

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
statusString

The status of the request:

  • success: The request succeeds.

  • failed: The request fails.

statusReasonStringThe reason why the request succeeds or fails.

Example

Request body

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

Response body

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

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

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
statusString

The status of the request:

  • success: The request succeeds.

  • failed: The request fails.

statusReasonStringThe reason why the request succeeds or fails.
dataObject

This 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

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

Response body

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

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

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
statusString

The status of the request:

  • success: The request succeeds.

  • failed: The request fails.

statusReasonStringThe reason why the request succeeds or fails.

Example

Request body

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

Response body

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

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

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
statusString

The status of the request:

  • success: The request succeeds.

  • failed: The request fails.

statusReasonStringThe reason why the request succeeds or fails.

Example

Request body

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

Response body

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