messages
Messages
Bases: ListableApiResource
, FindableApiResource
, UpdatableApiResource
, DestroyableApiResource
Nylas Messages API
The messages API allows you to send, find, update, and delete messages. You can also use the messages API to schedule messages to be sent at a later time. The Smart Compose API, allowing you to generate email content using machine learning, is also available.
Source code in nylas/resources/messages.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
smart_compose: SmartCompose
property
Access the Smart Compose collection of endpoints.
Returns:
Type | Description |
---|---|
SmartCompose
|
The Smart Compose collection of endpoints. |
clean_messages(identifier, request_body)
Remove extra information from a list of messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to clean the message for. |
required |
request_body |
CleanMessagesRequest
|
The values to clean the message with. |
required |
Returns:
Type | Description |
---|---|
ListResponse[CleanMessagesResponse]
|
The list of cleaned messages. |
Source code in nylas/resources/messages.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
destroy(identifier, message_id)
Delete a Message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to delete the message for. |
required |
message_id |
str
|
The identifier of the message to delete. |
required |
Returns:
Type | Description |
---|---|
DeleteResponse
|
The deletion response. |
Source code in nylas/resources/messages.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
find(identifier, message_id, query_params=None)
Return a Message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to get the message for. |
required |
message_id |
str
|
The identifier of the message to get. |
required |
query_params |
Optional[FindMessageQueryParams]
|
The query parameters to include in the request. |
None
|
Returns:
Type | Description |
---|---|
Response[Message]
|
The requested Message. |
Source code in nylas/resources/messages.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
find_scheduled_message(identifier, schedule_id)
Retrieve your scheduled messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to delete the message for. |
required |
schedule_id |
str
|
The id of the scheduled message to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
Response[ScheduledMessage]
|
The scheduled message. |
Source code in nylas/resources/messages.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
list(identifier, query_params=None)
Return all Messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to get messages for. |
required |
query_params |
Optional[ListMessagesQueryParams]
|
The query parameters to filter messages by. |
None
|
Returns:
Type | Description |
---|---|
ListResponse[Message]
|
A list of Messages. |
Source code in nylas/resources/messages.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
list_scheduled_messages(identifier)
Retrieve your scheduled messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to delete the message for. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
Response[List[ScheduledMessage]]
|
The list of scheduled messages. |
Source code in nylas/resources/messages.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
send(identifier, request_body)
Send a Message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to send the message for. |
required |
request_body |
SendMessageRequest
|
The request body to send the message with. |
required |
Returns:
Type | Description |
---|---|
Response[Message]
|
The sent message. |
Source code in nylas/resources/messages.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
stop_scheduled_message(identifier, schedule_id)
Stop a scheduled message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to delete the message for. |
required |
schedule_id |
str
|
The id of the scheduled message to stop. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
Response[StopScheduledMessageResponse]
|
The confirmation of the stopped scheduled message. |
Source code in nylas/resources/messages.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
update(identifier, message_id, request_body)
Update a Message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier |
str
|
The identifier of the grant to update the message for. |
required |
message_id |
str
|
The identifier of the message to update. |
required |
request_body |
UpdateMessageRequest
|
The request body to update the message with. |
required |
Returns:
Type | Description |
---|---|
Response[Message]
|
The updated Message. |
Source code in nylas/resources/messages.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|