Matrix Bridge Service
Project structure
This service will work as a proxy for dendrite service.
Sample example for matrix bridge service
Create user
Request -
curl --location --request POST 'http://localhost:8080/api/v1/matrix/user' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "usertest1",
"password": "test43215"
}'
Response -
{
"api_key": "dXNlcnRlc3QxLmEzN2NkNGNhMWQ3ZjE2Y2YxMjc1NzYxMTBmMTM4NTJkYzNhYWRmY2Q2Yzc2OGJmN2FkMDRiMWZmZWUwYTAzYmM",
"Hostname": "usertest1.matrix.mediamagic.ai"
}
Logged in user
Request -
curl --location --request POST 'http://localhost:8080/api/v1/matrix/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "usertest1",
"password": "test43215"
}'
Response -
{
"api_key": "dXNlcnRlc3QxLmEzN2NkNGNhMWQ3ZjE2Y2YxMjc1NzYxMTBmMTM4NTJkYzNhYWRmY2Q2Yzc2OGJmN2FkMDRiMWZmZWUwYTAzYmM"
}
NOTE - use this api_key for further authentication
Create dendrite
Request -
curl --location --request POST 'http://localhost:8080/api/v1/matrix/dendrite' \
--header "X-API-Key: $api_key" \
--header 'Content-Type: application/json' \
--data-raw '{
"hostname": "mycompany.matrix.mediamagic.com",
"port": "19999"
}'
Response -
{
"message": "success"
}
Create matterbridge
Request -
curl --location --request POST 'http://localhost:8080/api/v1/matrix/matterbridge' \
--header "X-API-Key: $api_key" \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "usertest",
"conf": {
"platform": "slack",
"token": "xoxb-899529480418-3690556338630-9SfpvRndDKGe20FdWFuwG3Rd",
"channel": "#media-magic"
}
}'
Response -
{
"network_name": "usertest",
"status": "success"
}
Last updated