Add a server to the federation
POST
/servers
const url = 'https://your-candig-domain/federation/v1/servers';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"server":{"id":"example","url":"https://candig.uhnresearch.ca","location":{"name":"UHN","province":"Ontario","province-code":"ca-on"},"testing":true},"authentication":{"issuer":"example","token":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-candig-domain/federation/v1/servers \ --header 'Content-Type: application/json' \ --data '{ "server": { "id": "example", "url": "https://candig.uhnresearch.ca", "location": { "name": "UHN", "province": "Ontario", "province-code": "ca-on" }, "testing": true }, "authentication": { "issuer": "example", "token": "example" } }'Add a server to the federation.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”register
boolean
Re-register all known servers/services
as_self
boolean
Register and mark this server as self
Request Body
Section titled “Request Body”Media typeapplication/json
object
server
required
A federated CanDIG instance in the network
object
id
required
Unique id for the server
string
url
required
Base URL of the CanDIG instance
string
Example
https://candig.uhnresearch.calocation
required
object
name
string
Example
UHNprovince
string
Example
Ontarioprovince-code
string
Example
ca-ontesting
If True, this is only registered as a test server in Federation, not in CanDIG overall
boolean
authentication
required
One of:
CanDIGv2 authentication
object
issuer
required
Issuer associated with the OIDC token.
string
token
required
OIDC access token issued to a user from the issuer. Can be expired, as long as it’s verifiable with the current public key.
string
Testing server
object
testing
required
If present and True, this is a request to register a testing server
boolean
Responses
Section titled “Responses”Server registered successfully
Server already registered
Authorization Error
Internal Error
