Discover Available services
🌐 Service Discovery APIs – REL-ID SDK Documentation
This document describes the following service discovery APIs available in the REL-ID SDK:
getAllServices()
getServiceByServiceName()
getServiceByTargetCoordinate()
📘 Overview
These APIs allow apps to discover services (e.g., intranet apps, internal APIs) that the current user is authorized to access via secure tunnels established by the SDK.
🔍 getAllServices()
getAllServices()
🧭 Purpose
Retrieve a list of all services available to the user based on REL-ID policy.
📤 Request
No parameters required.
📦 Response
Each service entry typically includes:
Field | Type | Description |
---|---|---|
serviceId | string | Unique ID of the service |
name | string | Human-readable service name |
host | string | Hostname or IP |
port | integer | Port number |
description | string | Description or notes (optional) |
✅ Sample Code
React Native
const services = await RdnaClient.getAllServices();
console.log(services);
Flutter
var services = await rdna.getAllServices();
print(services);
Cordova
com.uniken.rdnaplugin.RdnaClient.getAllServices(function(services) {
console.log(services);
});
Native Android
RdnaClient.getInstance().getAllServices(new RdnaCallback() {
@Override
public void onSuccess(Object result) {
Log.d("Services", result.toString());
}
@Override
public void onError(RdnaError error) {
Log.e("Error", error.getMessage());
}
});
Native iOS
RdnaClient.shared.getAllServices { result, error in
if let services = result {
print(services)
} else if let error = error {
print("Error: \(error.localizedDescription)")
}
}
🔎 getServiceByServiceName()
getServiceByServiceName()
🧭 Purpose
Fetch service info using its registered name.
📤 Request
{
"serviceName": "internalAppService"
}
Field | Type | Description |
---|---|---|
serviceName | string | Name assigned on REL-ID server |
✅ Sample Code
React Native
const service = await RdnaClient.getServiceByServiceName("internalAppService");
console.log(service);
Flutter
var service = await rdna.getServiceByServiceName("internalAppService");
print(service);
Cordova
com.uniken.rdnaplugin.RdnaClient.getServiceByServiceName("internalAppService", function(service) {
console.log(service);
});
Native Android
RdnaClient.getInstance().getServiceByServiceName("internalAppService", new RdnaCallback() {
@Override
public void onSuccess(Object result) {
Log.d("Service", result.toString());
}
@Override
public void onError(RdnaError error) {
Log.e("Error", error.getMessage());
}
});
Native iOS
RdnaClient.shared.getServiceByServiceName("internalAppService") { result, error in
if let service = result {
print(service)
} else if let error = error {
print("Error: \(error.localizedDescription)")
}
}
🎯 getServiceByTargetCoordinate()
getServiceByTargetCoordinate()
🧭 Purpose
Look up a service by host and port.
📤 Request
{
"host": "10.0.0.1",
"port": 443
}
Field | Type | Description |
---|---|---|
host | string | Target IP or domain |
port | integer | Port to connect |
✅ Sample Code
React Native
const service = await RdnaClient.getServiceByTargetCoordinate("10.0.0.1", 443);
console.log(service);
Flutter
var service = await rdna.getServiceByTargetCoordinate("10.0.0.1", 443);
print(service);
Cordova
com.uniken.rdnaplugin.RdnaClient.getServiceByTargetCoordinate("10.0.0.1", 443, function(service) {
console.log(service);
});
Native Android
RdnaClient.getInstance().getServiceByTargetCoordinate("10.0.0.1", 443, new RdnaCallback() {
@Override
public void onSuccess(Object result) {
Log.d("Service", result.toString());
}
@Override
public void onError(RdnaError error) {
Log.e("Error", error.getMessage());
}
});
Native iOS
RdnaClient.shared.getServiceByTargetCoordinate(host: "10.0.0.1", port: 443) { result, error in
if let service = result {
print(service)
} else if let error = error {
print("Error: \(error.localizedDescription)")
}
}
❗ Error Codes
Code | Description | Resolution |
---|---|---|
404 | Service not found | Check input or service policy |
401 | Unauthorized or session expired | Trigger login or refresh token |
500 | Internal server error | Retry or report issue |
📎 Use these APIs to dynamically discover services and build policy-based access UIs in your app.
Updated 3 months ago