Skip to main content

You are viewing Agora Docs forBetaproducts and features. Switch to Docs

Query notification service IP address

When using Agora real-time audio and video, you can use the Notifications service to receive channel events.

After activating the service, when a channel event occurs, the Notifications server will deliver the event notification to your message receiving server.

If your server is behind a firewall, you need to call the IP address query API to retrieve the IP addresses of Notifications and configure your firewall to trust all these IP addresses.

Agora occasionally adjusts the Notifications IP addresses. Best practice is to call this endpoint at least every 24 hours and automatically update the firewall configuration.

Prototype

  • Method: GET
  • Endpoint: https://api.agora.io/v2/ncs/ip

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 examples

Use one of the following code examples to test this request:

Sample request:

curl --request GET \
--url http://api.sd-rtn.com/v2/ncs/ip \
--header 'Accept: application/json' \
--header 'Authorization: '

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
dataObject
  • service
    • hosts
      • primaryIP: The IP address of the Notifications server. When you receive a response, you need to add the IP address (or list of IP addresses) from this field to the whitelist.

Response example

{  "data": {    "service": {      "hosts": [        {          "primaryIP": "xxx.xxx.xxx.xxx"        },        {          "primaryIP": "xxx.xxx.xxx.xxx"        }      ]    }  }}
vundefined