Peer to Peer
📫 Relays
Create a relay session with users.
Authorizations
Body
webhook_urlstringOptionalExample:
URL to send the session data to
https://my-webhook.com/dump
Responses
200
Success
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
500
Internal Server Error
application/json
503
Service Unavailable
application/json
post
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.
Authorizations
Responses
200
Success
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
500
Internal Server Error
application/json
get
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.
Authorizations
Path parameters
session_idanyRequired
Responses
204
No Content
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
503
Service Unavailable
application/json
delete
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.
Authorizations
Path parameters
session_idanyRequired
Responses
200
Success
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
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
Authorizations
Body
session_idstringRequiredExample:
Session Request ID (ex: 0724828881e2-S)
0724828881e2-S
user_ipstringRequiredExample:
User Ip to Authorize
1.1.1.1
Responses
200
Success
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
409
Conflict
application/json
500
Internal Server Error
application/json
503
Service Unavailable
application/json
post
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
Authorizations
Body
session_idstringRequiredExample:
Session Request ID (ex: 0724828881e2-S)
0724828881e2-S
authorization_tokenintegerRequiredExample:
Relay Authorization Token
3500589645
Responses
200
Success
application/json
204
No Content
400
Bad Request
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
503
Service Unavailable
application/json
post
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.
Authorizations
Body
namestringRequiredExample:
Name of the lobby
lobby_name
Responses
200
Success
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
409
Conflict
application/json
500
Internal Server Error
application/json
post
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
Authorizations
Responses
200
Success
application/json
401
Unauthorized
application/json
500
Internal Server Error
application/json
get
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.
Authorizations
Path parameters
lobby_nameanyRequired
Responses
200
Success
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
delete
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.
Authorizations
Path parameters
lobby_nameanyRequired
Responses
200
Success
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
409
Conflict
application/json
500
Internal Server Error
application/json
get
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.
Authorizations
Body
namestringRequiredExample:
Name of the lobby
lobby_name
Responses
202
Success
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
409
Conflict
application/json
500
Internal Server Error
application/json
post
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.
Authorizations
Body
namestringRequiredExample:
Name of the lobby
lobby_name
Responses
200
Success
application/json
202
Accepted
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
409
Conflict
application/json
500
Internal Server Error
application/json
post
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?