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.
Before implementing the provisioning API, ensure that your server meets the following requirements:
Agora waits for 500 millseconds after sending a request to your server. If there is no response, Agora resends the request for a maximum of two times.
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.
URL
POST https://{host}/customers/new
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. |
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. |
Request body
{
"planId": "ABC",
"customerName": "AgoraCustomerA",
"customerId": "12345678910",
"customerEmail": "AgoraCustomerA",
"customerPhone": "12345678910",
"apiKey": "pz**************************gd",
"signature": "Q7**************************xM"
}
Response body
{
"status": "success",
"statusReason": ""
}
When a user enables your extension for an Agora project, Agora calls this method to pass the project information to you.
URL
POST https://{host}/customers/{customerId}/projects/new
Path parametercustomerId
: 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. |
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. |
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://*********"
}
}
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.
URL
PUT http://{host}/customers/{customerId}/deactivate
Path parametercustomerId
: 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. |
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. |
Request body
{
"apiKey": "pz**************************gd",
"signature": "Q7**************************xM"
}
Response body
{
"status": "success",
"statusReason": ""
}
Once the user disables your extension for an Agora project, Agora calls this method to pass the project information to you.
URL
PUT http://{host}//customers/{customerId}/projects/{projectId}/deactivate
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. |
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. |
Request body
{
"apiKey": "pz**************************gd",
"signature": "Q7**************************xM"
}
Response body
{
"status": "success",
"statusReason": ""
}