1
1
# ` new Client(config) `
2
2
3
3
` Client ` is a class representing an API client. It provides methods
4
- corresponding to [ messaging APIs] ( https://developers.line.me /en/docs /messaging-api/reference / ) .
4
+ corresponding to [ messaging APIs] ( https://developers.line.biz /en/reference /messaging-api/ ) .
5
5
6
6
#### Type signature
7
7
@@ -149,7 +149,7 @@ class Client {
149
149
150
150
` Message ` is a valid message object. About message object structure, please
151
151
refer to [ Message and event objects] ( ./message-and-event-objects.md ) on this guide, or
152
- [ Send message object] ( https://developers.line.me /en/docs /messaging-api/reference /#message-objects )
152
+ [ Send message object] ( https://developers.line.biz /en/reference /messaging-api/#message-objects )
153
153
on the official documentation.
154
154
155
155
` ClientConfig ` type is like below.
@@ -171,7 +171,7 @@ When you call this first and call the API support that request option, then it w
171
171
For a parameter ` messages: messages: Message | Message[] ` , you can provide a
172
172
message object or an array of message objects. Both will work, but please beware
173
173
that there can be a limit on the number of the messages to be sent
174
- simultaneously. About the API detail, please refer to [ the official documentation] ( https://developers.line.me /en/docs /messaging-api/reference /#message-objects ) .
174
+ simultaneously. About the API detail, please refer to [ the official documentation] ( https://developers.line.biz /en/reference /messaging-api/#message-objects ) .
175
175
176
176
For functions returning ` Promise ` , there will be errors thrown if something
177
177
goes wrong, such as HTTP errors or parsing errors. You can catch them with the
@@ -182,7 +182,7 @@ in [the Client guide](../guide/client.md).
182
182
183
183
#### ` pushMessage(to: string, messages: Message | Message[], notificationDisabled: boolean = false): Promise<MessageAPIResponseBase> `
184
184
185
- It corresponds to the [ Push message] ( https://developers.line.me /en/docs /messaging-api/reference /#send-push-message ) API.
185
+ It corresponds to the [ Push message] ( https://developers.line.biz /en/reference /messaging-api/#send-push-message ) API.
186
186
187
187
The first argument is an ID of a receiver, and the second is messages to be sent.
188
188
@@ -195,10 +195,10 @@ client.pushMessage('user_or_group_or_room_id', {
195
195
196
196
#### ` replyMessage(replyToken: string, messages: Message | Message[], notificationDisabled: boolean = false): Promise<MessageAPIResponseBase> `
197
197
198
- It corresponds to the [ Reply message] ( https://developers.line.me /en/docs /messaging-api/reference /#send-reply-message ) API.
198
+ It corresponds to the [ Reply message] ( https://developers.line.biz /en/reference /messaging-api/#send-reply-message ) API.
199
199
200
200
The first argument is a reply token, which is retrieved from a webhook event
201
- object. For the list of replyable events, please refer to [ Webhook event object] ( https://developers.line.me /en/docs /messaging-api/reference /#webhook-event-objects )
201
+ object. For the list of replyable events, please refer to [ Webhook event object] ( https://developers.line.biz /en/reference /messaging-api/#webhook-event-objects )
202
202
of the official documentation. The second argument is the same with one in ` pushMessage() ` .
203
203
204
204
``` js
@@ -210,7 +210,7 @@ client.replyMessage(event.replyToken, {
210
210
211
211
#### ` multicast(to: string[], messages: Message | Message[], notificationDisabled: boolean = false): Promise<MessageAPIResponseBase> `
212
212
213
- It corresponds to the [ Multicast] ( https://developers.line.me /en/docs /messaging-api/reference/ #send-multicast-messages ) API.
213
+ It corresponds to the [ Multicast] ( https://developers.line.biz /en/reference /messaging-api/#send-multicast-message ) API.
214
214
215
215
The first argument is a list of receiver IDs, and the second is messages to be
216
216
sent.
@@ -237,7 +237,7 @@ client.broadcast({
237
237
238
238
#### ` getMessageContent(messageId: string): Promise<Readable> `
239
239
240
- It corresponds to the [ Content] ( https://developers.line.me /en/docs /messaging-api/reference /#get-content ) API.
240
+ It corresponds to the [ Content] ( https://developers.line.biz /en/reference /messaging-api/#get-content ) API.
241
241
242
242
The argument is an ID of media messages, such as image, video, and audio. The ID
243
243
can be retrieved from a message object of a message event.
@@ -262,7 +262,7 @@ client.getMessageContent('message_id')
262
262
263
263
#### ` getProfile(userId: string): Promise<Profile> `
264
264
265
- It corresponds to the [ Profile] ( https://developers.line.me /en/docs /messaging-api/reference /#get-profile ) API.
265
+ It corresponds to the [ Profile] ( https://developers.line.biz /en/reference /messaging-api/#get-profile ) API.
266
266
267
267
The argument is a user ID.
268
268
@@ -299,7 +299,7 @@ client.getGroupMembersCount('group_id').then((count) => {
299
299
300
300
#### ` getGroupMemberProfile(groupId: string, userId: string): Promise<Profile> `
301
301
302
- It corresponds to the [ Group Member Profile] ( https://developers.line.me /en/docs /messaging-api/reference /#get-group-member-profile ) API.
302
+ It corresponds to the [ Group Member Profile] ( https://developers.line.biz /en/reference /messaging-api/#get-group-member-profile ) API.
303
303
304
304
The arguments are a group ID and an ID of a user in the group. Please refer to
305
305
the official documentation for the difference between this API and ` getProfile() ` .
@@ -312,7 +312,7 @@ client.getGroupMemberProfile('group_id', 'user_id').then((profile) => {
312
312
313
313
#### ` getGroupMemberIds(groupId: string): Promise<string[]> `
314
314
315
- It corresponds to the [ Group Member IDs] ( https://developers.line.me /en/docs /messaging-api/reference /#get-group-member-user-ids ) API.
315
+ It corresponds to the [ Group Member IDs] ( https://developers.line.biz /en/reference /messaging-api/#get-group-member-user-ids ) API.
316
316
317
317
* FYI: This feature is only available for LINE@ Approved accounts or official accounts.*
318
318
@@ -326,7 +326,7 @@ client.getGroupMemberIds('group_id').then((ids) => {
326
326
327
327
#### ` leaveGroup(groupId: string): Promise<any> `
328
328
329
- It corresponds to the [ Leave group] ( https://developers.line.me /en/docs /messaging-api/reference /#leave-group ) API.
329
+ It corresponds to the [ Leave group] ( https://developers.line.biz /en/reference /messaging-api/#leave-group ) API.
330
330
331
331
The argument is a group ID.
332
332
@@ -349,7 +349,7 @@ client.getRoomMembersCount('room_id').then((count) => {
349
349
350
350
#### ` getRoomMemberProfile(roomId: string, userId: string): Promise<Profile> `
351
351
352
- It corresponds to the [ Room Member Profile] ( https://developers.line.me /en/docs /messaging-api/reference /#get-room-member-profile ) API.
352
+ It corresponds to the [ Room Member Profile] ( https://developers.line.biz /en/reference /messaging-api/#get-room-member-profile ) API.
353
353
354
354
The arguments are a room ID and an ID of a user in the room. Please refer to the
355
355
official documentation for the difference between this API and ` getProfile() ` .
@@ -362,7 +362,7 @@ client.getRoomMemberProfile('room_id', 'user_id').then((profile) => {
362
362
363
363
#### ` getRoomMemberIds(roomId: string): Promise<string[]> `
364
364
365
- It corresponds to the [ Room Member IDs] ( https://developers.line.me /en/docs /messaging-api/reference /#get-room-member-user-ids ) API.
365
+ It corresponds to the [ Room Member IDs] ( https://developers.line.biz /en/reference /messaging-api/#get-room-member-user-ids ) API.
366
366
367
367
* FYI: This feature is only available for LINE@ Approved accounts or official accounts.*
368
368
@@ -376,7 +376,7 @@ client.getRoomMemberIds('room_id').then((ids) => {
376
376
377
377
#### ` leaveRoom(roomId: string): Promise<any> `
378
378
379
- It corresponds to the [ Leave room] ( https://developers.line.me /en/docs /messaging-api/reference /#leave-room ) API.
379
+ It corresponds to the [ Leave room] ( https://developers.line.biz /en/reference /messaging-api/#leave-room ) API.
380
380
381
381
The argument is a room ID.
382
382
@@ -388,9 +388,9 @@ client.leaveGroup('room_id')
388
388
389
389
#### ` getRichMenu(richMenuId: string): Promise<RichMenuResponse> `
390
390
391
- It corresponds to the [ Get rich menu] ( https://developers.line.me /en/docs /messaging-api/reference /#get-rich-menu ) API.
391
+ It corresponds to the [ Get rich menu] ( https://developers.line.biz /en/reference /messaging-api/#get-rich-menu ) API.
392
392
393
- The argument is a rich menu ID. The return type is [ a rich menu response object] ( https://developers.line.me /en/docs /messaging-api/reference /#rich-menu-response-object ) .
393
+ The argument is a rich menu ID. The return type is [ a rich menu response object] ( https://developers.line.biz /en/reference /messaging-api/#rich-menu-response-object ) .
394
394
395
395
``` js
396
396
client .getRichMenu (' rich_menu_id' ).then ((richMenu ) => {
@@ -401,9 +401,9 @@ client.getRichMenu('rich_menu_id').then((richMenu) => {
401
401
402
402
#### ` createRichMenu(richMenu: RichMenu): Promise<string> `
403
403
404
- It corresponds to the [ Create rich menu] ( https://developers.line.me /en/docs /messaging-api/reference /#create-rich-menu ) API.
404
+ It corresponds to the [ Create rich menu] ( https://developers.line.biz /en/reference /messaging-api/#create-rich-menu ) API.
405
405
406
- The argument is [ a rich menu object] ( https://developers.line.me /en/docs /messaging-api/reference /#rich-menu-object ) .
406
+ The argument is [ a rich menu object] ( https://developers.line.biz /en/reference /messaging-api/#rich-menu-object ) .
407
407
For the detail of the object format, please refer to the official documentation.
408
408
It returns the result rich menu ID.
409
409
@@ -414,7 +414,7 @@ client.createRichMenu({ size: { width: 2500, height: 1686 }, ... })
414
414
415
415
#### ` deleteRichMenu(richMenuId: string): Promise<any> `
416
416
417
- It corresponds to the [ Delete rich menu] ( https://developers.line.me /en/docs /messaging-api/reference /#delete-rich-menu ) API.
417
+ It corresponds to the [ Delete rich menu] ( https://developers.line.biz /en/reference /messaging-api/#delete-rich-menu ) API.
418
418
419
419
The argument is a rich menu ID.
420
420
@@ -424,7 +424,7 @@ client.deleteRichMenu('rich_menu_id')
424
424
425
425
#### ` getRichMenuIdOfUser(userId: string): Promise<string> `
426
426
427
- It corresponds to the [ Get rich menu ID of user] ( https://developers.line.me /en/docs /messaging-api/reference /#get-rich-menu-id-of-user ) API.
427
+ It corresponds to the [ Get rich menu ID of user] ( https://developers.line.biz /en/reference /messaging-api/#get-rich-menu-id-of-user ) API.
428
428
429
429
The argument is a user ID. It returns a rich menu ID to be used with other APIs.
430
430
@@ -436,7 +436,7 @@ client.getRichMenuIdOfUser('user_id').then((richMenuId) => {
436
436
437
437
#### ` linkRichMenuToUser(userId: string, richMenuId: string): Promise<any> `
438
438
439
- It corresponds to the [ Link rich menu to user] ( https://developers.line.me /en/docs /messaging-api/reference /#link-rich-menu-to-user ) API.
439
+ It corresponds to the [ Link rich menu to user] ( https://developers.line.biz /en/reference /messaging-api/#link-rich-menu-to-user ) API.
440
440
441
441
The arguments are a user ID and a rich menu ID.
442
442
@@ -446,7 +446,7 @@ client.linkRichMenuToUser('user_id', 'rich_menu_id')
446
446
447
447
#### ` unlinkRichMenuFromUser(userId: string, richMenuId: string): Promise<any> `
448
448
449
- It corresponds to the [ Unlink rich menu from user] ( https://developers.line.me /en/docs /messaging-api/reference /#unlink-rich-menu-from-user ) API.
449
+ It corresponds to the [ Unlink rich menu from user] ( https://developers.line.biz /en/reference /messaging-api/#unlink-rich-menu-from-user ) API.
450
450
451
451
The arguments are a user ID and a rich menu ID.
452
452
@@ -476,7 +476,7 @@ client.unlinkRichMenuFromUser('user_id', 'rich_menu_id')
476
476
477
477
#### ` getRichMenuImage(richMenuId: string): Promise<Readable> `
478
478
479
- It corresponds to the [ Download rich menu image] ( https://developers.line.me /en/docs /messaging-api/reference /#download-rich-menu-image ) API.
479
+ It corresponds to the [ Download rich menu image] ( https://developers.line.biz /en/reference /messaging-api/#download-rich-menu-image ) API.
480
480
481
481
The argument is a rich menu ID.
482
482
@@ -498,7 +498,7 @@ client.getRichMenuImage('rich_menu_id')
498
498
499
499
#### ` setRichMenuImage(richMenuId: string, data: Buffer | Readable, contentType?: string): Promise<any> `
500
500
501
- It corresponds to the [ Upload rich menu image] ( https://developers.line.me /en/docs /messaging-api/reference /#upload-rich-menu-image ) API.
501
+ It corresponds to the [ Upload rich menu image] ( https://developers.line.biz /en/reference /messaging-api/#upload-rich-menu-image ) API.
502
502
503
503
The 1st argument is a rich menu ID. For 2nd argument, a buffer or a readable
504
504
stream of an image should be provided. For the restriction of the image, please
@@ -512,28 +512,28 @@ client.setRichMenuImage('rich_menu_id', fs.createReadStream('./some_image.png'))
512
512
513
513
#### ` getRichMenuList(): Promise<Array<RichMenuResponse>> `
514
514
515
- It corresponds to the [ Get rich menu list] ( https://developers.line.me /en/docs /messaging-api/reference /#get-rich-menu-list ) API.
515
+ It corresponds to the [ Get rich menu list] ( https://developers.line.biz /en/reference /messaging-api/#get-rich-menu-list ) API.
516
516
517
- The return type is a list of [ rich menu response objects] ( https://developers.line.me /en/docs /messaging-api/reference /#rich-menu-response-object ) .
517
+ The return type is a list of [ rich menu response objects] ( https://developers.line.biz /en/reference /messaging-api/#rich-menu-response-object ) .
518
518
519
519
### ` setDefaultRichMenu(richMenuId: string): Promise<{}> `
520
520
521
- It corresponds to the [ Set default rich menu] ( https://developers.line.me /en/reference/messaging-api/#set-default-rich-menu ) API.
521
+ It corresponds to the [ Set default rich menu] ( https://developers.line.biz /en/reference/messaging-api/#set-default-rich-menu ) API.
522
522
523
523
### ` getDefaultRichMenuId(): Promise<string> `
524
524
525
- It corresponds to the [ Get default rich menu ID] ( https://developers.line.me /en/reference/messaging-api/#get-default-rich-menu-id ) API.
525
+ It corresponds to the [ Get default rich menu ID] ( https://developers.line.biz /en/reference/messaging-api/#get-default-rich-menu-id ) API.
526
526
527
527
### ` deleteDefaultRichMenu(): Promise<{}> `
528
528
529
- It corresponds to the [ Cancel default rich menu] ( https://developers.line.me /en/reference/messaging-api/#cancel-default-rich-menu ) API.
529
+ It corresponds to the [ Cancel default rich menu] ( https://developers.line.biz /en/reference/messaging-api/#cancel-default-rich-menu ) API.
530
530
531
531
### Account link
532
532
533
533
#### ` getLinkToken(userId: string): Promise<string> `
534
534
535
535
Send an HTTP POST request to the ` /bot/user/{userId}/linkToken ` endpoint,
536
- and [ issue a link token] ( https://developers.line.me /en/reference/messaging-api/#issue-link-token ) for the user you are attempting to link.
536
+ and [ issue a link token] ( https://developers.line.biz /en/reference/messaging-api/#issue-link-token ) for the user you are attempting to link.
537
537
538
538
If the request succeeds, a link token will be returned.
539
539
Link tokens are valid for 10 minutes and can only be used once.
0 commit comments