I want to send a broadcast email using Aweber .NET API. I can authenticate and I can retrieve a list of subscribers.
When I create a broadcast, it creates succesfully (the request doesn't fail) and I get back a JSON containing the info about the broadcast that I've just created. However, in the aweber account, I go to broadcasts and I don't see anything about the broadcast I've just created using the API! It is not sent, or scheduled or draft. It simply doesn't exist.
This is the code that I use for creating the broadcast:
string endpoint = string.Format("https://api.aweber.com/1.0/accounts/{0}/lists/{1}/broadcasts", account_id, list_id);
Request request = new Request
{
oauth_consumer_key = consumerKey,
oauth_consumer_secret = consumerSecret,
oauth_token = token,
oauth_token_secret = api.OAuthTokenSecret
};
SortedList<string, string> parameters = new SortedList<string, string>();
parameters.Add("click_tracking_enabled", "True");
parameters.Add("is_archived", "True");
parameters.Add("notify_on_send", "True");
parameters.Add("body_text", "xxxxx");
parameters.Add("subject", "yyyyyy");
request.Build(parameters, endpoint);
WebClient client = new WebClient();
client.Headers["Content-type"] = "application/x-www-form-urlencoded";
string str = string.Empty;
str = client.UploadString(endpoint, request.Parameters);
After execution, the str string has the following content:
As you can see, the "sent" property is null, so basically it is not sent.
Thank you.