Q&A

originalContentUrl and previewImageUrl not in webhook payload

Pre condition, Condition to reproduce

When receiving an image on the webhook, I miss the image details.

Issue/ Error Message details

I do not see the originalContentUrl and previewImageUrl

Documentation: https://developers.line.biz/en/reference/messaging-api/#image-message

{
  "type": "image",
  "originalContentUrl": "https://example.com/original.jpg",
  "previewImageUrl": "https://example.com/preview.jpg"
}

My code:

{
    type: 'message',
    message: {
      type: 'image',
      id: '456610429378302636',
      contentProvider: [Object]
    },
    webhookEventId: '01H18NX3ZR37F0T3ANSZNPEEMQ',
    deliveryContext: { isRedelivery: false },
    timestamp: 1684992331261,
    source: { type: 'user', userId: 'U6ee450ed25c7deaeebce0506e90600a2' },
    replyToken: 'f144669e79844bb4b82ce02e215ecc03',
    mode: 'active'
  }

Accompanying respective source code

See code above

Resolution Tried

Reference information (Version / Platform/ environment)

Arch Linux, NodeJS, latest Line SDK

  • 0
  • 1
  • 108
  • twitter facebook

According to https://developers.line.biz/en/reference/messaging-api/#wh-image

contentProvider.type : external: The URL of the image file is included in the contentProvider.originalContentUrl property. If the provider of the image file is external, the binary data of the image file can't be retrieved by using the Get content endpoint.

I guess type is external, though your example hide it.

  • 1

関連する質問

    関連する質問はありません

本当によろしいですか? question.vm