Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add Image Example in Header in Template Creation #115

Open
bhavesh53 opened this issue Aug 22, 2023 · 4 comments
Open

How to add Image Example in Header in Template Creation #115

bhavesh53 opened this issue Aug 22, 2023 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@bhavesh53
Copy link

Hello want to know how to add Example Image in Template Creation. i found below example but I don't understand which data need to pass in addHeaderHandleExamples argument .

https://github.com/Bindambc/whatsapp-business-java-api/blob/95580cfebc9de0610d7f7c9730192bc4f228fcf1/src/test/java/com/whatsapp/api/examples/CreateMessageTemplate6Example.java#L35C1-L35C1

@github-actions
Copy link

Hello and welcome! We're glad to see that you've opened your first issue. We appreciate your contribution and would love to hear more about the problem you're experiencing. Our team is actively monitoring this repository and we will do our best to respond to your issue as soon as possible. Thank you for using our project and we look forward to working with you!

@Cavassoni
Copy link
Collaborator

Hello. The mentioned example is sending a media ID generated from the Resumable Upload API It's a longer process for uploading files.

An alternative would be to send the media identification "url." To make it easier, follow the UploadMediaExample and RetrieveMediaUrlExample samples, which will return the "url" you can use in the addHeaderHandleExamples

@Cavassoni Cavassoni added the question Further information is requested label Aug 28, 2023
@Cavassoni Cavassoni reopened this Aug 28, 2023
@bhavesh53
Copy link
Author

Hello @Cavassoni i tried but when ever i upload with below code . but its rejected instantly .

   var template = new MessageTemplate();

        template.setName("template_310823")
                .setCategory(Category.MARKETING)
                .setLanguage(LanguageType.EN)
                .addComponent(new HeaderComponent().setFormat(HeaderFormat.IMAGE)
                        .setExample(new Example().addHeaderHandleExamples()
                                .addHeaderHandleExamples("https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=9xxx89620xxxxxxx&ext=1693xxxxxx&hash=ATtrDAQxxxxxxxxxx")))
                .addComponent(new BodyComponent()//
                        .setText("this is example body"));

@Bindambc Bindambc added the enhancement New feature or request label Sep 5, 2023
@Bindambc
Copy link
Owner

Bindambc commented Sep 5, 2023

Hello @bhavesh53, we don't have support for the Resumable Upload API yet. This is the API that returns the "id" used in the examples. We'll be adding this functionality soon.

There's an example of how this API works in a Postman collection, which can be accessed at this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants