Federation
Federation and external identity
curl -X GET "https://example.com/users/me/identity"fetch("https://example.com/users/me/identity")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/identity"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/identity"
response = requests.request("GET", url)
print(response.text)Empty
Patch Users Me Alias
Update current user alias (username for federation)
Request Body
application/jsonRequiredaliasRequiredstringResponse Body
curl -X PATCH "https://example.com/users/me/alias" \
-H "Content-Type: application/json" \
-d '{
"alias": "string"
}'const body = JSON.stringify({
"alias": "string"
})
fetch("https://example.com/users/me/alias", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/alias"
body := strings.NewReader(`{
"alias": "string"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/alias"
body = {
"alias": "string"
}
response = requests.request("PATCH", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Empty
Put Users Me Keys
Register or update federation public keys
Request Body
application/jsonRequiredsigningKeyRequiredstringencryptionKeyRequiredstringResponse Body
curl -X PUT "https://example.com/users/me/keys" \
-H "Content-Type: application/json" \
-d '{
"signingKey": "string",
"encryptionKey": "string"
}'const body = JSON.stringify({
"signingKey": "string",
"encryptionKey": "string"
})
fetch("https://example.com/users/me/keys", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/keys"
body := strings.NewReader(`{
"signingKey": "string",
"encryptionKey": "string"
}`)
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/keys"
body = {
"signingKey": "string",
"encryptionKey": "string"
}
response = requests.request("PUT", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Empty
Post Federation Inbox
Receive federation messages from other servers
Request Body
application/jsonRequiredtypeRequiredstringfromRequiredstringtoRequiredstringtimestampRequiredstringsignatureRequiredstringpayloadobjectResponse Body
curl -X POST "https://example.com/federation/inbox" \
-H "Content-Type: application/json" \
-d '{
"type": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
}'const body = JSON.stringify({
"type": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
})
fetch("https://example.com/federation/inbox", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/federation/inbox"
body := strings.NewReader(`{
"type": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/federation/inbox"
body = {
"type": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Empty