PubSub Events

Grape Call

class grapecall.events.CallBaseEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

Base class for all Grape Call events

Returns

  • event - call.new

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • organization_id (int) - ID of the organization

  • title (string) - Just a text. Usually, not useful

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

  • affected_user (object) - user object (optional). User who should react to this event

    • id (int) - User’s ID

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

Return type

Object

data()
message = ''
name = 'new'
ns = 'call'
class grapecall.events.CallFinishedEvent(call)

This event will be sent when a call finishes.

Returns

  • event - call.finished

  • time (string) - ISO8601 timestamp

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

Return type

Object

name = 'finished'
class grapecall.events.CallStartedEvent(call)

This event will be sent when a call starts.

Returns

  • event - call.started

  • time (string) - ISO8601 timestamp

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

  • calls (object) - DEPRECATED - list of Grape Call object containing all calls on that channel. See get().

Return type

Object

data()
name = 'started'
ns = 'call'
class grapecall.events.HungUpCallEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

This event will be sent when a user leaves a call.

Returns

  • event - call.hungup

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • title (string) - Just a text. Usually, not useful

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • call (object) - Grape Call object. See get()

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • session_key (string) - the Grape Call session related to the member who hung up

  • active_sessions (list)* - all remaining sessions that user has

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

Return type

Object

data()
message = 'Hung up Call'
name = 'hungup'
class grapecall.events.IncomingCallEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

This event will be sent when a user calls another user. It’s supposed to trigger a incoming call screen on clients.

Returns

  • event - call.incoming

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • organization_id (int) - ID of the organization

  • title (string) - Just a text. Usually, not useful

  • url (string) - URL to the call (deprecated)

  • grapecall_url (string) - URL to the call

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

Return type

Object

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

data()
message = 'Incoming Call'
name = 'incoming'
class grapecall.events.InvitedCallEvent(users, call, channel, inviter)

This event will be sent when a user calls another user. It’s supposed to trigger a incoming call screen on clients.

Returns

  • event - call.invited

  • time (string) - ISO8601 timestamp

  • call_id (string) - Grape Call ID

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

  • users (list) - list of user objects
    • id (int) - ID of the user

    • avatar (string) - an image to be displayed as user avatar

    • display_name (string) - a text to be displayed as user name

Those fields are deprecated and will be removed. Don’t use them.

  • call_id (string) - Grape Call ID

Return type

Object

data()
name = 'invited'
ns = 'call'
class grapecall.events.JoinedCallEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

This event will be sent when a user joins a call.

Returns

  • event - call.joined

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • organization_id (int) - ID of the organization

  • title (string) - Just a text. Usually, not useful

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

  • session_key (string) - the Grape Call session related to the member who joined the call

Return type

Object

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

message = 'Joined Call'
name = 'joined'
class grapecall.events.ManualCanceledEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

This event will be sent when the receiver didn’t accept an invitation to a group call after 30s (time may vary according to configuration). It has exactly the same structure as MissedCallEvent but manual is “True”

Returns

  • event - call.missed

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • organization_id (int) - ID of the organization

  • title (string) - Just a text. Usually, not useful

  • manual (boolean) - It will be True if user canceled the invitation manually or False otherwise

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

Return type

Object

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

class grapecall.events.MissedCallEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

This event will be sent either when the receiver didn’t answer a call after 30s (time may vary according to configuration) or when the call initiator hung up before the receiver answered the call.

Returns

  • event - call.missed

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • organization_id (int) - ID of the organization

  • title (string) - Just a text. Usually, not useful

  • manual (boolean) - It will be True if user canceled the invitation manually or False otherwise

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

Return type

Object

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

data()
message = 'Missed Call'
name = 'missed'
class grapecall.events.RejectedCallEvent(author, call, channel, affected_user=None, session_key: Optional[str] = None)

This event will be sent when the receiver rejects an incoming call.

Returns

  • event - call.rejected

  • time (string) - ISO8601 timestamp

  • message (string) - Just a text. Usually, not useful

  • organization_id (int) - ID of the organization

  • title (string) - Just a text. Usually, not useful

  • channel (object) - Channel object

    • id (int) - ID of the channel

    • name (string) - Channel name, if it’s a group, or empty otherwise

    • type (string) - It will be either “room” or “pm”

    • color (string) - hexadecimal color code - e.g. #BC7215

    • icon (string) - icon-slug for display in sidebar.

  • author (object) - user object that represents the user who triggered the event (author)

    • id (int) - author’s ID

    • avatar (string) - an image to be displayed as event’s author avatar

    • display_name (string) - a text to be displayed as event’s author name

  • call (object) - Grape Call object. See get()

Return type

Object

Those fields are deprecated and will be removed. Don’t use them.

  • author_id (int) - ID of the user whose action triggered the event

  • author_display_name (string) - A text to be displayed as event’s author name

  • author_avatar_url (string) - An image to be displayed as event’s author avatar

  • channel_id (int) - ID of the channel

  • channel_name (string) - Channel name, if it’s a group, or empty otherwise

  • channel_type (string) - It will be either “room” or “pm”

  • call_id (string) - Grape Call ID

  • started_at (string) - time (ISO8601) when call was started

message = 'Rejected Call'
name = 'rejected'