For the complete documentation index, see llms.txt. This page is also available as Markdown.

中继

📫 中继

Create a Relay Session

post

Create a relay session with users.

授权
Authorizationstring必填
头参数
Acceptstring可选Example: */*
Content-Typestring必填Example: application/json
请求体
webhook_urlstring可选

URL to send the session data to

Example: https://my-webhook.com/dump
响应
200

Success

application/json
session_idstring必填

The session ID

Example: 7349356945f1-S
authorization_tokeninteger可选

The authorization token for the session

Example: 3500589645
statusstring必填

The status of the session

Example: READY
readyboolean必填

If the session is ready to be used

linkedboolean必填

If the session is linked to a relay

errorstring可选

The error message if the session failed

Example: Session failed
webhook_urlstring可选

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

Example: https://my-webhook.com/dump
post/v1/relays/sessions
POST /v1/relays/sessions HTTP/1.1
Host: api.edgegap.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 69

{
  "users": [],
  "filters": [],
  "webhook_url": "https://my-webhook.com/dump"
}
{
  "session_id": "7349356945f1-S",
  "authorization_token": 3500589645,
  "status": "READY",
  "ready": true,
  "linked": true,
  "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"
}

Get a Relay Session

get

Retrieve the information for a relay session.

授权
Authorizationstring必填
路径参数
session_idstring必填
头参数
Acceptstring可选Example: */*
Content-Typestring必填Example: application/json
响应
200

Success

application/json
session_idstring必填

The session ID

Example: 7349356945f1-S
authorization_tokeninteger可选

The authorization token for the session

Example: 3500589645
statusstring必填

The status of the session

Example: READY
readyboolean必填

If the session is ready to be used

linkedboolean必填

If the session is linked to a relay

errorstring可选

The error message if the session failed

Example: Session failed
webhook_urlstring可选

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

Example: https://my-webhook.com/dump
get/v1/relays/sessions/{session_id}
GET /v1/relays/sessions/{session_id} HTTP/1.1
Host: api.edgegap.com
Authorization: YOUR_API_KEY
Content-Type: text
Accept: */*
{
  "session_id": "7349356945f1-S",
  "authorization_token": 3500589645,
  "status": "READY",
  "ready": true,
  "linked": true,
  "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"
}

List all Relay Sessions

get

List all the active relay sessions.

授权
Authorizationstring必填
头参数
Acceptstring可选Example: */*
Content-Typestring必填Example: application/json
响应
200

Success

application/json
total_countinteger必填Example: 100
get/v1/relays/sessions
GET /v1/relays/sessions HTTP/1.1
Host: api.edgegap.com
Authorization: YOUR_API_KEY
Content-Type: text
Accept: */*
{
  "sessions": [
    {
      "session_id": "7349356945f1-S",
      "authorization_token": 3500589645,
      "status": "READY",
      "ready": true,
      "linked": true,
      "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"
    }
  ],
  "total_count": 100,
  "pagination": {
    "number": 1,
    "next_page_number": 2,
    "previous_page_number": 1,
    "paginator": {
      "num_pages": 10
    },
    "has_next": true,
    "has_previous": false
  }
}

Authorize a user on a Relay Session

post

Authorize a user on a Relay Session

授权
Authorizationstring必填
头参数
Acceptstring可选Example: */*
Content-Typestring必填Example: application/json
请求体
session_idstring必填

Session Request ID (ex: 0724828881e2-S)

Example: 0724828881e2-S
user_ipstring必填

User Ip to Authorize

Example: 1.1.1.1
响应
200

Success

application/json
session_idstring必填

The session ID

Example: 7349356945f1-S
authorization_tokeninteger可选

The authorization token for the session

Example: 3500589645
statusstring必填

The status of the session

Example: READY
readyboolean必填

If the session is ready to be used

linkedboolean必填

If the session is linked to a relay

errorstring可选

The error message if the session failed

Example: Session failed
session_userany可选
relayany可选
webhook_urlstring可选

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

Example: https://my-webhook.com/dump
post/v1/relays/sessions:authorize-user
POST /v1/relays/sessions:authorize-user HTTP/1.1
Host: api.edgegap.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "session_id": "0724828881e2-S",
  "user_ip": "1.1.1.1"
}
{
  "session_id": "7349356945f1-S",
  "authorization_token": 3500589645,
  "status": "READY",
  "ready": true,
  "linked": true,
  "error": "Session failed",
  "session_user": {},
  "relay": {},
  "webhook_url": "https://my-webhook.com/dump"
}

Remove a user on a Relay Session

post

Authorize a user on a Relay Session

授权
Authorizationstring必填
头参数
Acceptstring可选Example: */*
Content-Typestring必填Example: application/json
请求体
session_idstring必填

Session Request ID (ex: 0724828881e2-S)

Example: 0724828881e2-S
authorization_tokeninteger必填

Relay Authorization Token

Example: 3500589645
响应
200

Success

application/json
session_idstring必填

The session ID

Example: 7349356945f1-S
authorization_tokeninteger可选

The authorization token for the session

Example: 3500589645
statusstring必填

The status of the session

Example: READY
readyboolean必填

If the session is ready to be used

linkedboolean必填

If the session is linked to a relay

errorstring可选

The error message if the session failed

Example: Session failed
webhook_urlstring可选

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

Example: https://my-webhook.com/dump
post/v1/relays/sessions:revoke-user
POST /v1/relays/sessions:revoke-user HTTP/1.1
Host: api.edgegap.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 64

{
  "session_id": "0724828881e2-S",
  "authorization_token": 3500589645
}
{
  "session_id": "7349356945f1-S",
  "authorization_token": 3500589645,
  "status": "READY",
  "ready": true,
  "linked": true,
  "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"
}

Delete a Relay Session

delete

Delete a relay session.

授权
Authorizationstring必填
路径参数
session_idstring必填
头参数
Acceptstring可选Example: */*
Content-Typestring必填Example: application/json
响应
204

No Content

无内容

delete/v1/relays/sessions/{session_id}
DELETE /v1/relays/sessions/{session_id} HTTP/1.1
Host: api.edgegap.com
Authorization: YOUR_API_KEY
Content-Type: text
Accept: */*

无内容

最后更新于

这有帮助吗?