Open brunopedrosa opened 10 months ago
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!
Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'COPY_CODE' as a subtype of com.whatsapp.api.domain.templates.Button
: known type ids = [Button, PHONE_NUMBER, QUICK_REPLY, URL] (for POJO property 'buttons')
Hello @brunopedrosa, thank you for informing. This is a new feature that has been added to the API as per the changelog.
API documentation: https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates
I'll be implementing this feature soon. If you've already implemented something related, feel free to share.
Hello @Bindambc,
It seems to be working, but I'm not sure if the code is 100%. It would be a good idea to give it a review.
package com.whatsapp.api.domain.templates;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.whatsapp.api.domain.templates.type.ButtonType;
/**
* The type Quick reply button.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CopyCodeButton extends Button {
@JsonProperty("example")
private List<String> urlExample;
/**
* Instantiates a new Copy code button.
*/
protected CopyCodeButton() {
super(ButtonType.COPY_CODE);
}
/**
* Instantiates a new Copy code button.
*
* @param text the text
*/
public CopyCodeButton(String text) {
super(ButtonType.COPY_CODE, text);
}
public List<String> getUrlExample() {
return urlExample;
}
public void setUrlExample(List<String> urlExample) {
this.urlExample = urlExample;
}
}
package com.whatsapp.api.domain.templates.type;
/**
* The enum Button type.
*/
public enum ButtonType {
/**
* Phone number button type.
*/
PHONE_NUMBER,
/**
* Url button type.
*/
URL,
/**
* Quick reply button type.
*/
QUICK_REPLY,
/**
* Copy code button type.
*/
COPY_CODE
}
Can you assign this issue to me?
Is the new 'COPY_CODE' button type working? (edited: it seems not work)