Skip to content

PostWhatsAppMessageMedia

Source: src/AWS/SocialMessaging/PostWhatsAppMessageMedia.ts

Runtime binding for social-messaging:PostWhatsAppMessageMedia.

Uploads a media file to WhatsApp (from an S3 object or presigned URL) so it can be referenced by mediaId in outbound messages sent from the given phone number.

The caller addresses one of the bound account’s phone numbers per request; phone-number ARNs are provisioned by Meta under the WABA, so the deploy-time half grants social-messaging:PostWhatsAppMessageMedia on *. Provide the implementation with Effect.provide(AWS.SocialMessaging.PostWhatsAppMessageMediaHttp).

// init — bind the operation to the linked WABA
const postMedia = yield* AWS.SocialMessaging.PostWhatsAppMessageMedia(account);
// runtime
const { mediaId } = yield* postMedia({
originationPhoneNumberId: "phone-number-id-0123456789abcdef",
sourceS3File: { bucketName: "my-assets", key: "welcome.png" },
});