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
Request body The request body contains the following fields:
Field | Required/Optional | Type | Data length | Description |
---|---|---|---|---|
planId | Required | String | 16 | The billing plan that the user selects. |
customerName | Optional | String | 32 | The company name of the user. |
customerId | Required | String | N/A | The account ID of the user on Agora Console. |
customerEmail | Optional | String | 32 | The email address of the user. |
customerPhone | Optional | String | 32 | The phone number of the user. |
apiKey | Required | String | 32 | The API key, used for authentication between you and Agora. You need to generate your own API key and provide it to Agora. |
signature | Required | String | N/A | The 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:
Field | Type | Description |
---|---|---|
status | String | The status of the request: success : The request succeeds.failed : The request fails. |
statusReason | String | The reason why the request succeeds or fails. |
Example
Request body
Response body
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
Path parameter
customerId
: String. The account ID of the user on Agora Console.
Request body The request body contains the following fields:
Field | Required/Optional | Type | Data length | Description |
---|---|---|---|---|
projectId | Required | Int | N/A | The ID of the Agora project. A user could enable your extension for multiple projects, which means one customerId could be mapped to multiple projectId s. |
apiKey | Required | String | 32 | The API key, used for authentication between you and Agora. You need to generate your own API key and provide it to Agora. |
signature | Required | String | N/A | The 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:
Field | Type | Description |
---|---|---|
status | String | The status of the request: success : The request succeeds.failed : The request fails. |
statusReason | String | The reason why the request succeeds or fails. |
data | Object | 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
Response body
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
Path parameter
customerId
: String. The ID of the user on Agora Console.
Request body The request body contains the following fields:
Field | Required/Optional | Type | Data length | Description |
---|---|---|---|---|
apiKey | Required | String | 32 | The 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. |
signature | Required | String | N/A | The 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:
Field | Type | Description |
---|---|---|
status | String | The status of the request: success : The request succeeds.failed : The request fails. |
statusReason | String | The reason why the request succeeds or fails. |
Example
Request body
Response body
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
Path parameter
Parameter | Type | Description |
---|---|---|
customerId | String | The account ID of the user on Agora Console. |
projectId | Int | The ID of the project for which the user wants to disable your extension. |
Request body The request body contains the following fields:
Field | Required/Optional | Type | Data length | Description |
---|---|---|---|---|
apiKey | Required | String | 32 | The 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. |
signature | Required | String | N/A | The 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:
Field | Type | Description |
---|---|---|
status | String | The status of the request:success : The request succeeds.failed : The request fails. |
statusReason | String | The reason why the request succeeds or fails. |
Example
Request body
Response body