ex_matrix_api v0.1.2 ExMatrixApi.Synapse
API level to make requests to Matrix Synapse.
Link to this section Summary
Functions
Read config settings.
Create new room for user's conversation.
Convert mxc URI into http URL for download
Decline invite to join room.
Gets event by id
Get authorization token by login / password.
Check if synapse allowing to register specific username.
Join room by accepting invite.
Gets list of room members
Leave room.
Redacts event
Register new user on Matrix synapse.
Get secure room id from it's alias.
Get list of messages in a specific room.
Get full room state.
Get list of room names.
Send new file message in a specific room.
Send new notice message in a specific room.
Send new text message in a specific room.
Mark room events as read.
Get major user data in scope synapse.
Convert mxc URI into http URL for display.
Change room state, by executing state event.
Update specific field of user's data, currently supported only for display name and avatar.
Update display name, avatar or password.
Upload file and return mxc:// URI of the uploaded asset.
Link to this section Types
invites()
Specs
invites() :: %{ required(String.t()) => ExMatrixApi.Synapse.Rooms.InviteState.t() }
timelines()
Specs
timelines() :: %{required(String.t()) => ExMatrixApi.Synapse.Rooms.Timeline.t()}
Link to this section Functions
config!(key)
Specs
Read config settings.
create_room(token, payload)
Specs
Create new room for user's conversation.
download(arg)
Specs
Convert mxc URI into http URL for download
forget_invited_room(token, room_uid)
Specs
Decline invite to join room.
get_event(token, room, event_id)
Specs
get_event(String.t(), String.t(), String.t()) :: {:ok, ExMatrixApi.Synapse.Rooms.Event.t()} | {:error, UtilsHttp.Behaviour.HttpClient.HttpError.t()}
Gets event by id
get_token(user, password)
Specs
Get authorization token by login / password.
is_username_available?(username)
Specs
Check if synapse allowing to register specific username.
join_invited_room(token, room_uid)
Specs
Join room by accepting invite.
joined_members(token, room)
Specs
joined_members(String.t(), String.t()) :: {:ok, [ExMatrixApi.Synapse.Rooms.Member.t()]} | {:error, any()}
Gets list of room members
leave_room(token, room_uid)
Specs
Leave room.
redact_event(token, room, event_id, reason \\ "delete")
Specs
redact_event(String.t(), String.t(), String.t(), String.t()) :: {:ok, ExMatrixApi.Synapse.Rooms.Event.t()} | {:error, UtilsHttp.Behaviour.HttpClient.HttpError.t()}
Redacts event
register(username, password, params \\ %{})
Specs
register(String.t(), String.t(), map()) :: {:ok, ExMatrixApi.Synapse.RegisteredUser.t()} | {:error, any()}
Register new user on Matrix synapse.
room_id_by_alias(token, room_alias)
Specs
Get secure room id from it's alias.
room_messages(token, room_id, from, limit \\ 20, dir \\ "b")
Specs
room_messages(Sring.t(), String.t(), String.t(), integer(), String.t()) :: {:ok, {[map()], String.t(), String.t()}} | {:error, any()}
Get list of messages in a specific room.
room_state(token, room_id)
Specs
room_state(String.t(), String.t()) :: {:ok, [ExMatrixApi.Synapse.Rooms.Event.t()]} | {:error, any()}
Get full room state.
rooms(token)
Specs
Get list of room names.
send_file_message(token, room, file_content, map)
Specs
send_file_message(String.t(), String.t(), String.t(), %{ content_type: String.t(), description: String.t(), filename: nil | String.t() }) :: {:ok, ExMatrixApi.Synapse.Rooms.Event.t()} | {:error, UtilsHttp.Behaviour.HttpClient.HttpError.t()}
Send new file message in a specific room.
send_notice_message(token, room, text, formatted_body \\ nil)
Specs
send_notice_message(String.t(), String.t(), String.t(), String.t() | nil) :: {:ok, ExMatrixApi.Synapse.Rooms.Event.t()} | {:error, any()}
Send new notice message in a specific room.
send_text_message(token, room, text, formatted_body \\ nil)
Specs
send_text_message(String.t(), String.t(), String.t(), String.t() | nil) :: {:ok, ExMatrixApi.Synapse.Rooms.Event.t()} | {:error, any()}
Send new text message in a specific room.
set_read_marker(token, room, to_event_id)
Specs
Mark room events as read.
sync(token, params \\ %{})
Specs
Get major user data in scope synapse.
thumbnail(arg, width, height)
Specs
Convert mxc URI into http URL for display.
update_room_state(token, room_id, event_type, payload \\ %{}, state_key \\ "")
Specs
update_room_state(String.t(), String.t(), String.t(), map(), String.t()) :: {:ok, String.t()} | {:error, any()}
Change room state, by executing state event.
update_user(token, user_id, atom, new_name)
Specs
Update specific field of user's data, currently supported only for display name and avatar.
update_user(token, atom, user_id, old_password, new_password)
Specs
Update display name, avatar or password.
upload_media(token, content_type, bin, filename \\ nil)
Specs
upload_media(String.t(), String.t(), binary(), String.t() | nil) :: {:ok, String.t()} | {:error, any()}
Upload file and return mxc:// URI of the uploaded asset.