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

Getting templates with buttons #118

Closed
xenastro opened this issue Dec 28, 2024 · 1 comment
Closed

Getting templates with buttons #118

xenastro opened this issue Dec 28, 2024 · 1 comment

Comments

@xenastro
Copy link

Hello,

When I call GetTemplateByNameAsync or GetAllTemplatesAsync, the response type does not include properties for buttons if the template has buttons.

This is a correct example of it can be mapped from return json:

public class Template
{
[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("components")]
public List<Component> Components { get; set; }

[JsonProperty("language")]
public string Language { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("category")]
public string Category { get; set; }

[JsonProperty("id")]
public string Id { get; set; }

}

public class Component
{
[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("format")]
public string Format { get; set; }

[JsonProperty("text")]
public string Text { get; set; }

[JsonProperty("example")]
public Example Example { get; set; }

[JsonProperty("buttons")]
public List<Button> Buttons { get; set; }

}

public class Example
{
[JsonProperty("body_text")]
public List<List> BodyText { get; set; }

[JsonProperty("header_handle")]
public List<string> ImageUrls { get; set; }

}

public class Button
{
[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("text")]
public string Text { get; set; }

[JsonProperty("url")]
public string Url { get; set; }  // For URL type buttons

[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }  // For PHONE_NUMBER type buttons

}

@gabrieldwight
Copy link
Owner

hi, let me have a look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants