Relays

Create a Relay Session

Create a relay session with users.

post/v1/relays/sessions

Request

  • Base URL: https://api.edgegap.com
  • URL: https://api.edgegap.com/v1/relays/sessions
  • Auth: API key in header authorization

Request body

webhook_urlstring

URL to send the session data to

Example request

{
  "users": [
    {
      "ip": "1.1.1.1"
    }
  ],
  "filters": [
    {
      "field": "location",
      "values": [
        "US"
      ],
      "filter_type": "any"
    }
  ],
  "webhook_url": "https://my-webhook.com/dump"
}

Response

Success

session_idstring required

The session ID

authorization_tokeninteger

The authorization token for the session

statusstring required

The status of the session

readyboolean required

If the session is ready to be used

linkedboolean required

If the session is linked to a relay

errorstring

The error message if the session failed

webhook_urlstring

The webhook URL that we will call once the session is ready

Example response

{
  "session_id": "7349356945f1-S",
  "authorization_token": 3500589645,
  "status": "READY",
  "error": "Session failed",
  "session_users": [
    {
      "ip_address": "1.1.1.1",
      "latitude": 45.5088,
      "longitude": -73.5878,
      "authorization_token": 21986334
    }
  ],
  "relay": {
    "ip": "2.2.2.2",
    "host": "7349356945f1.st.edgegap.net",
    "ports": {
      "server": {
        "port": 32000,
        "protocol": "UDP",
        "link": "7349356945f1.st.edgegap.net:32000"
      },
      "client": {
        "port": 32001,
        "protocol": "UDP",
        "link": "7349356945f1.st.edgegap.net:32001"
      }
    }
  },
  "webhook_url": "https://my-webhook.com/dump"
}

Changes

No recorded changes to this operation across all 1 revision of this API.