Peer to Peer
📫 Relays
Create a relay session with users.
URL to send the session data to
https://my-webhook.com/dump
Success
Bad Request
Unauthorized
Forbidden
Internal Server Error
Service Unavailable
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"
}
List all the active relay sessions.
Success
Unauthorized
Forbidden
Internal Server Error
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
}
}
Delete a relay session.
No Content
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
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.
Success
Unauthorized
Forbidden
Not Found
Internal Server Error
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"
}
Authorize a user on a Relay Session
Session Request ID (ex: 0724828881e2-S)
0724828881e2-S
User Ip to Authorize
1.1.1.1
Success
Bad Request
Unauthorized
Forbidden
Conflict
Internal Server Error
Service Unavailable
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
Success
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Service Unavailable
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"
}
🏨 Lobby Manager
Create a named lobby.
Name of the lobby
lobby_name
Success
Bad Request
Unauthorized
Conflict
Internal Server Error
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"
}
List the Lobbies
Success
Unauthorized
Internal Server Error
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.
Success
Bad Request
Unauthorized
Not Found
Internal Server Error
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.
Success
Bad Request
Unauthorized
Not Found
Conflict
Internal Server Error
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"
}
Deploy the lobby with the given name.
Name of the lobby
lobby_name
Success
Bad Request
Unauthorized
Conflict
Internal Server Error
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
Success
Accepted
Bad Request
Unauthorized
Not Found
Conflict
Internal Server Error
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"
}
Last updated
Was this helpful?