FastSms/ core wrapper code
FastSms.Tests/ tests of the core wrapper code
The minimum requirement by FastSMS wrapper is that your Visual Studio supported .Net Framework 4.5.
FastSMS has a Knowledge Base and a Developer Zone which cover every detail of FastSMS API.
Add reference "FastSms" to your project.
Your token (found in your settings within NetMessenger)
var fastSmsClient = new Client('your token');
List all API codes found in docs
using FastSms;
...
var fastSmsClient = new Client('Your token');
try {
var credits = client.CheckCredits();
} catch (ApiException apiException) {
Console.writeline(apiException.Message, apiException.Code);
} catch (Exception ex) {
Console.Writeline(ex.Message);
}
Checks your current credit balance.
var credits = client.CheckCredits();//returns double value
Sends a message. More information read here
...
using FastSms;
using FastSms.Models;
...
// Initialize message for user/users.
var message = new MessageToUserModel {
DestinationAddress = "Address",
SourceAddress = "Your source",
Body = "Message text"
};
// Initialize message for group.
var message = new MessageToGroupModel {
GroupName = "Group name",
SourceAddress = "Your source",
Body = "Message text"
};
// Initialize message for list.
var message = new MessageToListModel {
ListName = "List name",
SourceAddress = "Your source",
Body = "Message text"
};
client.SendMessage(message);
Check send message status. More information read here
var messageStatus = client.CheckMessageStatus(messageId)//message id must be string
Create new child user. Only possible if you are an admin user. More information read here
...
using FastSms;
using FastSms.Models;
...
// Initialize user data
var userData = new UserModel {
FirstName = "User first name",
LastName = "User Last name",
AccessLevel = "Normal",
ChildPassword = "Password",
Email = "email@example.com",
Credits = 100,
Telephone = "123456789"
};
client.CreateUser( userData );
Transfer credits to/from a child user. Only possible if you are an admin user. More information read here
...
using FastSms;
using FastSms.Models;
...
// Initialize update user data
var childUsername = "username";
var quantity = 10;
client.UpdateCredits( childUsername, quantity );
Retrieve the data from a report. More information read here Aviable types:
- ArchivedMessages
- ArchivedMessagesWithBodies
- ArchivedMessagingSummary
- BackgroundSends
- InboundMessages
- KeywordMessageList
- Messages
- MessagesWithBodies
- SendsByDistributionList
- Usage
...
using FastSms;
...
// Get report
var report = client.GetReports (reportType, dateFrom, dateTo)//reportType - enumerable, dates - in string
Create contact(s). More information read here
...
using FastSms;
...
// Initialize contacts data
var contacts = new List<ContactsCSVModel> {
new ContactsCSVModel {
Name = "Contact name",
Number = "Contact number"
},
new ContactsCSVModel {
Name = "Contact name",
Number = "Contact number",
Group1 = "Contact group"
},
// Add contacts
var result = client.ImportContactsCsv(contacts);
More information read here
...
using FastSms;
...
client.DeleteAllContacts();
More information read here
...
using FastSms;
...
client.DeleteAllGroups();
Remove all contacts from the specified group. More information read here
...
using FastSms;
...
client.EmptyGroup('Group Name');
Delete the specified group. More information read here
...
using FastSms;
...
client.DeleteGroup('Group Name');