-
Notifications
You must be signed in to change notification settings - Fork 61
/
office.internetheaders.yml
463 lines (358 loc) · 20.4 KB
/
office.internetheaders.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
### YamlMime:TSType
name: Office.InternetHeaders
uid: 'outlook!Office.InternetHeaders:interface'
package: outlook!
fullName: Office.InternetHeaders
summary: >-
The `InternetHeaders` object represents custom internet headers that are preserved after the message item leaves
Exchange and is converted to a MIME message.
Internet headers are stored as string key-value pairs on a per-item basis.
**Note**: This object is intended for you to set and get your custom headers on a message item. To learn more, see
[Get and set internet headers on a message in an Outlook
add-in](https://learn.microsoft.com/office/dev/add-ins/outlook/internet-headers)<!-- -->.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!-- -->**:
**read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Compose
**Important**: The internet headers API is supported in Outlook on Android and on iOS starting in Version
4.2405.0. To learn more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs supported
in Outlook on mobile devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
**Recommended practices**:
Currently, internet headers are a finite resource on a user's mailbox. When the quota is exhausted, you can't create
any more internet headers on that mailbox, which can result in unexpected behavior from clients that rely on this to
function.
Apply the following guidelines when you create internet headers in your add-in.
- Create the minimum number of headers required. The header quota is based on the total size of headers applied to a
message. In Exchange Online, the header limit is capped at 256 KB, while in an Exchange on-premises environment, the
limit is determined by your organization's administrator. For further information on header limits, see [Exchange
Online message
limits](https://learn.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits)
and [Exchange Server message
limits](https://learn.microsoft.com/exchange/mail-flow/message-size-limits?view=exchserver-2019#types-of-message-size-limits)<!--
-->.
- Name headers so that you can reuse and update their values later. As such, avoid naming headers in a variable manner
(for example, based on user input or a timestamp).
isPreview: false
isDeprecated: false
type: interface
methods:
- name: 'getAsync(names, options, callback)'
uid: 'outlook!Office.InternetHeaders#getAsync:member(1)'
package: outlook!
fullName: 'getAsync(names, options, callback)'
summary: >-
Given an array of internet header names, this method returns a record containing those internet headers and their
values. If the add-in requests a header that isn't available, that header won't be returned in the results.
**Note**: This method is intended to return the values of the custom headers you set using the `setAsync`
method.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose
**Important**: The internet headers API is supported in Outlook on Android and on iOS starting in Version
4.2405.0. To learn more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs
supported in Outlook on mobile
devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/70-mime-headers/manage-custom-internet-headers-message-compose.yaml
Office.context.mailbox.item.internetHeaders.getAsync(
["preferred-fruit", "preferred-vegetable", "best-vegetable", "nonexistent-header"],
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Selected headers: " + JSON.stringify(asyncResult.value));
} else {
console.log("Error getting selected headers: " + JSON.stringify(asyncResult.error));
}
}
);
```
isPreview: false
isDeprecated: false
syntax:
content: >-
getAsync(names: string[], options: Office.AsyncContextOptions, callback: (asyncResult:
Office.AsyncResult<Record<string, string>>) => void): void;
parameters:
- id: names
description: The names of the internet headers to be returned.
type: 'string[]'
- id: options
description: >-
An object literal that contains one or more of the following properties:- `asyncContext`<!-- -->: Developers
can provide any object they wish to access in the callback function.
type: '<xref uid="office!Office.AsyncContextOptions:interface" />'
- id: callback
description: >-
When the method completes, the function passed in the `callback` parameter is called with a single
parameter, `asyncResult`<!-- -->, of type `Office.AsyncResult`<!-- -->. The string key-value pairs of
internet headers are returned in the `asyncResult.value` property. Any errors encountered are provided in
the `asyncResult.error` property.
type: >-
(asyncResult: <xref uid="office!Office.AsyncResult:interface" /><Record<string, string>>) =>
void
return:
type: void
description: ''
- name: 'getAsync(names, callback)'
uid: 'outlook!Office.InternetHeaders#getAsync:member(2)'
package: outlook!
fullName: 'getAsync(names, callback)'
summary: >-
Given an array of internet header names, this method returns a record containing those internet headers and their
values. If the add-in requests a header that isn't available, that header won't be returned in the results.
**Note**: This method is intended to return the values of the custom headers you set using the `setAsync`
method.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose
**Important**: The internet headers API is supported in Outlook on Android and on iOS starting in Version
4.2405.0. To learn more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs
supported in Outlook on mobile
devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
isPreview: false
isDeprecated: false
syntax:
content: 'getAsync(names: string[], callback: (asyncResult: Office.AsyncResult<Record<string, string>>) => void): void;'
parameters:
- id: names
description: The names of the internet headers to be returned.
type: 'string[]'
- id: callback
description: >-
When the method completes, the function passed in the `callback` parameter is called with a single
parameter, `asyncResult`<!-- -->, of type `Office.AsyncResult`<!-- -->. The string key-value pairs of
internet headers are returned in the `asyncResult.value` property. Any errors encountered are provided in
the `asyncResult.error` property.
type: >-
(asyncResult: <xref uid="office!Office.AsyncResult:interface" /><Record<string, string>>) =>
void
return:
type: void
description: ''
- name: 'removeAsync(names, options, callback)'
uid: 'outlook!Office.InternetHeaders#removeAsync:member(1)'
package: outlook!
fullName: 'removeAsync(names, options, callback)'
summary: >-
Given an array of internet header names, this method removes the specified headers from the internet header
collection.
**Note**: This method is intended to remove the custom headers you set using the `setAsync` method.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read/write item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose
**Important**: The internet headers API is supported in Outlook on Android and on iOS starting in Version
4.2405.0. To learn more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs
supported in Outlook on mobile
devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/70-mime-headers/manage-custom-internet-headers-message-compose.yaml
Office.context.mailbox.item.internetHeaders.removeAsync(
["best-vegetable", "nonexistent-header"],
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Successfully removed selected headers");
} else {
console.log("Error removing selected headers: " + JSON.stringify(asyncResult.error));
}
}
);
```
isPreview: false
isDeprecated: false
syntax:
content: >-
removeAsync(names: string[], options: Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
parameters:
- id: names
description: The names of the internet headers to be removed.
type: 'string[]'
- id: options
description: >-
An object literal that contains one or more of the following properties:- `asyncContext`<!-- -->: Developers
can provide any object they wish to access in the callback function.
type: '<xref uid="office!Office.AsyncContextOptions:interface" />'
- id: callback
description: >-
Optional. When the method completes, the function passed in the `callback` parameter is called with a single
parameter, `asyncResult`<!-- -->, of type `Office.AsyncResult`<!-- -->. Any errors encountered are provided
in the `asyncResult.error` property.
type: '(asyncResult: <xref uid="office!Office.AsyncResult:interface" /><void>) => void'
return:
type: void
description: ''
- name: 'removeAsync(names, callback)'
uid: 'outlook!Office.InternetHeaders#removeAsync:member(2)'
package: outlook!
fullName: 'removeAsync(names, callback)'
summary: >-
Given an array of internet header names, this method removes the specified headers from the internet header
collection.
**Note**: This method is intended to remove the custom headers you set using the `setAsync` method.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read/write item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose
**Important**: The internet headers API is supported in Outlook on Android and on iOS starting in Version
4.2405.0. To learn more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs
supported in Outlook on mobile
devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
isPreview: false
isDeprecated: false
syntax:
content: 'removeAsync(names: string[], callback?: (asyncResult: Office.AsyncResult<void>) => void): void;'
parameters:
- id: names
description: The names of the internet headers to be removed.
type: 'string[]'
- id: callback
description: >-
Optional. When the method completes, the function passed in the `callback` parameter is called with a single
parameter, `asyncResult`<!-- -->, of type `Office.AsyncResult`<!-- -->. Any errors encountered are provided
in the `asyncResult.error` property.
type: '(asyncResult: <xref uid="office!Office.AsyncResult:interface" /><void>) => void'
return:
type: void
description: ''
- name: 'setAsync(headers, options, callback)'
uid: 'outlook!Office.InternetHeaders#setAsync:member(1)'
package: outlook!
fullName: 'setAsync(headers, options, callback)'
summary: >-
Sets the specified internet headers to the specified values.
The `setAsync` method creates a new header if the specified header doesn't already exist; otherwise, the existing
value is replaced with the new value.
**Note**: This method is intended to set the values of your custom headers.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read/write item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose
**Important**:
- The internet headers API is supported in Outlook on Android and on iOS starting in Version 4.2405.0. To learn
more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs supported in Outlook on
mobile devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
- The header quota is based on the total size of headers applied to a message. In Exchange Online, the header
limit is capped at 256 KB, while in an Exchange on-premises environment, the limit is determined by your
organization's administrator. For further information on header limits, see [Exchange Online message
limits](https://learn.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits)
and [Exchange Server message
limits](https://learn.microsoft.com/exchange/mail-flow/message-size-limits?view=exchserver-2019#types-of-message-size-limits)<!--
-->.
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/70-mime-headers/manage-custom-internet-headers-message-compose.yaml
Office.context.mailbox.item.internetHeaders.setAsync(
{ "preferred-fruit": "orange", "preferred-vegetable": "broccoli", "best-vegetable": "spinach" },
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Successfully set headers");
} else {
console.log("Error setting headers: " + JSON.stringify(asyncResult.error));
}
}
);
```
isPreview: false
isDeprecated: false
syntax:
content: >-
setAsync(headers: Record<string, string>, options: Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
parameters:
- id: headers
description: >-
The names and corresponding values of the headers to be set. This should be a record object with its keys
being internet header names and values being the corresponding header value strings.
type: 'Record<string, string>'
- id: options
description: >-
An object literal that contains one or more of the following properties:- `asyncContext`<!-- -->: Developers
can provide any object they wish to access in the callback function.
type: '<xref uid="office!Office.AsyncContextOptions:interface" />'
- id: callback
description: >-
Optional. When the method completes, the function passed in the `callback` parameter is called with a single
parameter, `asyncResult`<!-- -->, of type `Office.AsyncResult`<!-- -->. Any errors encountered are provided
in the `asyncResult.error` property.
type: '(asyncResult: <xref uid="office!Office.AsyncResult:interface" /><void>) => void'
return:
type: void
description: ''
- name: 'setAsync(headers, callback)'
uid: 'outlook!Office.InternetHeaders#setAsync:member(2)'
package: outlook!
fullName: 'setAsync(headers, callback)'
summary: >-
Sets the specified internet headers to the specified values.
The `setAsync` method creates a new header if the specified header doesn't already exist; otherwise, the existing
value is replaced with the new value.
**Note**: This method is intended to set the values of your custom headers.
remarks: >-
\[ [API set: Mailbox 1.8](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!--
-->**: **read/write item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!--
-->**: Compose
**Important**:
- The internet headers API is supported in Outlook on Android and on iOS starting in Version 4.2405.0. To learn
more about features supported in Outlook on mobile devices, see [Outlook JavaScript APIs supported in Outlook on
mobile devices](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-mobile-apis)<!-- -->.
- The header quota is based on the total size of headers applied to a message. In Exchange Online, the header
limit is capped at 256 KB, while in an Exchange on-premises environment, the limit is determined by your
organization's administrator. For further information on header limits, see [Exchange Online message
limits](https://learn.microsoft.com/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits#message-limits)
and [Exchange Server message
limits](https://learn.microsoft.com/exchange/mail-flow/message-size-limits?view=exchserver-2019#types-of-message-size-limits)<!--
-->.
isPreview: false
isDeprecated: false
syntax:
content: 'setAsync(headers: Record<string, string>, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;'
parameters:
- id: headers
description: >-
The names and corresponding values of the headers to be set. This should be a record object with its keys
being internet header names and values being the corresponding header value strings.
type: 'Record<string, string>'
- id: callback
description: >-
Optional. When the method completes, the function passed in the `callback` parameter is called with a single
parameter, `asyncResult`<!-- -->, of type `Office.AsyncResult`<!-- -->. Any errors encountered are provided
in the `asyncResult.error` property.
type: '(asyncResult: <xref uid="office!Office.AsyncResult:interface" /><void>) => void'
return:
type: void
description: ''