Push Notifications

class grapecall.notifications.IncomingCallNotification(channel, call, initiator_id=None, receivers=None, session_key: Optional[str] = None)

This push notification is sent to the user who is being called.

Returns

  • call_id (string) - Grape Call ID

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

  • type (string) - the notification type. In this case, “incoming_call”

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

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

  • organization_id (int) - ID of the organization

  • 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”

  • title (string) - Author’s display name

  • 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

  • url (string) - Grape Call URL

  • expiration (float) - Unix Timestamp (in seconds) containing the expiration of the notification, that is, when it’s not valid anymore and should be ignored

FCM pushes will have these extra fields:

  • organization_name (string) -

  • organization_logo_url (string) -

  • room_name (string) - It will be either the group name or the author’s name (for PMs)

  • matched_types (string) - The notification type. In this case, “incoming_call”

  • priority (string) - Always “high”

APNS pushes will have these extra fields:

  • sound (string) - the sound file that should be used for this notification

  • collapse_id (string) -

  • category (string) - The notification type. In this case, “incoming_call”

  • mutable_content (boolean) - True

Return type

Object

class grapecall.notifications.MissedCallNotification(channel, call, initiator_id=None, receivers=None, session_key: Optional[str] = None)

This push notification is sent to the user who missed an incoming call.

Returns

  • call_id (string) - Grape Call ID

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

  • type (string) - the notification type. In this case, “missed_call”

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

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

  • organization_id (int) - ID of the organization

  • 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”

  • title (string) - Author’s display name

  • 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

  • url (string) - Grape Call URL

FCM pushes will have these extra fields:

  • organization_name (string) -

  • organization_logo_url (string) -

  • room_name (string) - It will be either the group name or the author’s name (for PMs)

  • matched_types (string) - The notification type. In this case, “missed_call”

  • priority (string) - Always “high”

APNS pushes will have these extra fields:

  • sound (string) - the sound file that should be used for this notification

  • collapse_id (string) -

  • category (string) - The notification type. In this case, “missed_call”

  • mutable_content (boolean) - True

Return type

Object

class grapecall.notifications.JoinedCallNotification(channel, call, initiator_id=None, receivers=None, session_key: Optional[str] = None)

This push notification is sent when someone joins a call.

Returns

  • call_id (string) - Grape Call ID

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

  • type (string) - the notification type. In this case, “joined_call”

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

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

  • organization_id (int) - ID of the organization

  • 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”

  • title (string) - Author’s display name

  • 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

  • url (string) - Grape Call URL

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

FCM pushes will have these extra fields:

  • organization_name (string) -

  • organization_logo_url (string) -

  • room_name (string) - It will be either the group name or the author’s name (for PMs)

  • matched_types (string) - The notification type. In this case, “joined_call”

  • priority (string) - Always “high”

APNS pushes will have these extra fields:

  • sound (string) - the sound file that should be used for this notification

  • collapse_id (string) -

  • category (string) - The notification type. In this case, “joined_call”

  • mutable_content (boolean) - True

Return type

Object

class grapecall.notifications.RejectedCallNotification(channel, call, initiator_id=None, receivers=None, session_key: Optional[str] = None)

This push notification is sent to a user rejects an incoming call.

Returns

  • call_id (string) - Grape Call ID

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

  • type (string) - the notification type. In this case, “rejected_call”

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

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

  • organization_id (int) - ID of the organization

  • 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”

  • title (string) - Author’s display name

  • 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

  • url (string) - Grape Call URL

FCM pushes will have these extra fields:

  • organization_name (string) -

  • organization_logo_url (string) -

  • room_name (string) - It will be either the group name or the author’s name (for PMs)

  • matched_types (string) - The notification type. In this case, “rejected_call”

  • priority (string) - Always “high”

APNS pushes will have these extra fields:

  • sound (string) - the sound file that should be used for this notification

  • collapse_id (string) -

  • category (string) - The notification type. In this case, “rejected_call”

  • mutable_content (boolean) - True

Return type

Object

class grapecall.notifications.HungUpCallNotification(channel, call, initiator_id=None, receivers=None, session_key: Optional[str] = None)

This push notification is sent when someone hangs up.

Returns

  • call_id (string) - Grape Call ID

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

  • type (string) - the notification type. In this case, “hungup_call”

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

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

  • organization_id (int) - ID of the organization

  • 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”

  • title (string) - Author’s display name

  • 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

  • url (string) - Grape Call URL

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

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

FCM pushes will have these extra fields:

  • organization_name (string) -

  • organization_logo_url (string) -

  • room_name (string) - It will be either the group name or the author’s name (for PMs)

  • matched_types (string) - The notification type. In this case, “hungup_call”

  • priority (string) - Always “high”

APNS pushes will have these extra fields:

  • sound (string) - the sound file that should be used for this notification

  • collapse_id (string) -

  • category (string) - The notification type. In this case, “hungup_call”

  • mutable_content (boolean) - True

Return type

Object

class grapecall.notifications.RejectedGroupCallNotification(channel, call, initiator_id=None, receivers=None, session_key: Optional[str] = None)

This push notification is sent when someone rejects a group call invitation.

Returns

  • call_id (string) - Grape Call ID

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

  • type (string) - the notification type. In this case, “rejected_group_call”

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

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

  • organization_id (int) - ID of the organization

  • 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”

  • title (string) - Author’s display name

  • 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

  • url (string) - Grape Call URL

FCM pushes will have these extra fields:

  • organization_name (string) -

  • organization_logo_url (string) -

  • room_name (string) - It will be either the group name or the author’s name (for PMs)

  • matched_types (string) - The notification type. In this case, “rejected_group_call”

  • priority (string) - Always “high”

APNS pushes will have these extra fields:

  • sound (string) - the sound file that should be used for this notification

  • collapse_id (string) -

  • category (string) - The notification type. In this case, “rejected_group_call”

  • mutable_content (boolean) - True

Return type

Object