Peer to Peer
Last updated
Was this helpful?
Last updated
Was this helpful?
Delete a relay session.
DELETE /v1/relays/sessions/{session_id} HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Accept: */*
No content
Retrieve the information for a relay session.
GET /v1/relays/sessions/{session_id} HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
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 the Lobbies
GET /v1/lobbies HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Accept: */*
{
"name": "lobby_name",
"url": "https://lobby.com",
"status": "Released"
}
Delete a named lobby.
DELETE /v1/lobbies/{lobby_name} HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Accept: */*
{
"name": "lobby_name",
"url": "https://lobby.com",
"status": "Released"
}
Get a named lobby.
GET /v1/lobbies/{lobby_name} HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Accept: */*
{
"name": "lobby_name",
"url": "https://lobby.com",
"status": "Released"
}
List all the active relay sessions.
GET /v1/relays/sessions HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
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"
}
],
"pagination": {
"number": 1,
"next_page_number": 1,
"previous_page_number": 1,
"paginator": {
"num_pages": 1
},
"has_next": true,
"has_previous": true
}
}
Create a relay session with users.
URL to send the session data to
https://my-webhook.com/dump
POST /v1/relays/sessions HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 141
{
"users": [
{
"ip": "1.1.1.1"
}
],
"filters": [
{
"field": "location",
"values": [
"US"
],
"filter_type": "any"
}
],
"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"
}
Authorize a user on a Relay Session
Session Request ID (ex: 0724828881e2-S)
0724828881e2-S
User Ip to Authorize
1.1.1.1
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": {
"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"
}
Authorize a user on a Relay Session
Session Request ID (ex: 0724828881e2-S)
0724828881e2-S
Relay Authorization Token
3500589645
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"
}
Create a named lobby.
Name of the lobby
lobby_name
POST /v1/lobbies HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"name": "lobby_name"
}
{
"name": "lobby_name",
"url": "https://lobby.com",
"status": "Released"
}
Deploy the lobby with the given name.
Name of the lobby
lobby_name
POST /v1/lobbies:deploy HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"name": "lobby_name"
}
{
"name": "lobby_name",
"url": "https://lobby.com",
"status": "Released"
}
Terminate the lobby with the given name.
Name of the lobby
lobby_name
POST /v1/lobbies:terminate HTTP/1.1
Host: api.edgegap.com
authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"name": "lobby_name"
}
{
"name": "lobby_name",
"url": "https://lobby.com",
"status": "Released"
}