FAQs C++ SOAP SDK

AccountService interface

Enables you to find out information about your Account.

Implemented by AccountService class

EsendexLib::AccountService spAccountService; spAccountService.CreateInstance(uuidof(EsendexLib::AccountService)); 

Initialise method

Initialise the class with your Esendex credentials. You must call this method before you call any other on the interface.

Initialise(_bstr_t Username, _bstr_t Password, _bstr_t Account, _variant_t IsServerSide); 

Parameters

  • Username Your Esendex username.
  • Password Your Esendex password.
  • Account Your Esendex Account Reference.
  • IsServerSide (optional) True if the component is running within an ASP page; false or otherwise. The default is false.

GetMessageLimit function

Returns the remaining Message Limit on your Account.

long GetMessageLimit();

Return Value: The number of Messages remaining on your Account.

GetAccountFeatures function

Returns the features that are enabled on your Account.

long GetAccountFeatures();

Return Value: The features enabled on your Account. This can be a combination of: ACCOUNT_FEATURE_NONE, ACCOUNT_FEATURE_SERVICE_ALIASING and ACCOUNT_FEATURE_INBOX

GetAccountState function

Returns a state object that contains information about your Account.

IAccountStatePtr GetAccountState();

Return Value: An object that contains information about your Account, including the Id assigned by Esendex, the Account Reference, Address, Alias, Message Limit and features.

ContactService interface

Enables you to retrieve, add, edit and delete Contacts and Contact Groups.

Implemented by ContactService class

EsendexLib::ContactService spContactService;

spContactService.CreateInstance(uuidof(EsendexLib::ContactService)); 

Initialise method

Initialise the class with your Esendex credentials. You must call this method before you call any other on the interface.

Initialise(_bstr_t Username, _bstr_t Password, _bstr_t Account, _variant_t IsServerSide); 

Parameters

  • Username Your Esendex username.
  • Password Your Esendex password.
  • Account Your Esendex Account Reference.
  • IsServerSide (optional) True if the component is running within an ASP page; false or otherwise. The default is false.

GetContacts function

Returns a list of Contacts associated with your Account.

IObjectCollectionPtr GetContacts();

Return Value: A collection containing the Contacts associated with your Account.

GetGroups function

Returns a list of Contact Groups associated with your Account.

IObjectCollectionPtr GetGroups ();

Return Value: A collection containing the Contact Groups associated with your Account.

AddContact function

Adds a Contact to your Account.

_bstr_t AddContact(IContactPtr Contact);

Parameters

  • Contact The Contact you want to add.

Return Value: The Id assigned to the Contact by Esendex.

AddContacts function

Adds multiple Contacts to your Account.

IStringCollection2Ptr AddContact(IObjectCollectionPtr Contacts);

Parameters

  • Contacts A collection containing the Contacts you want to add.

Return Value: A collection containing the Ids assigned to the Contacts by Esendex.

AddGroup function

Adds a Contact Group to your Account.

_bstr_t AddGroup(IGroupPtr Group, _bstr_t MemberIDs);

Parameters

  • Group The Contact Group you want to add.
  • MemberIDs A comma-separated list containing the Ids of the Contacts that should become members of the Contact Group.

Return Value: The Id assigned to the Contact Group by Esendex.

DeleteContact method

Deletes a Contact from your Account.

void DeleteContact(_bstr_t ContactID);

Parameters

  • ContactID The Id of the Contact you want to delete.

DeleteContacts method

Deletes multiple Contacts from your Account.

void DeleteContacts(_bstr_t ContactIDs);

Parameters

  • ContactIDs A comma-separated list containing the Ids of the Contacts you want to delete.

DeleteGroup method

Deletes a Contact Group from your Account.

void DeleteContact(_bstr_t GroupID, _variant_t IncludeMembers);

Parameters

  • GrouptID The Id of the Contact Group you want to delete.
  • IncludeMembers (optional) True if you want to delete the Contact members as well as the Contact Group.

UpdateContact method

Updates one of your Account’s Contacts.

void UpdateContact(IContactPtr Contact);

Parameters

  • Contact The Contact you want to update.

UpdateGroup method

Updates one of your Account’s Contact Groups.

void UpdateGroup(IGroupPtr Group, _bstr_t MemberIDs);

Parameters

  • Group The Contact Group you want to update.
  • MemberIDs A comma-separated list containing the Ids of the Contacts that should become members of the Contact Group.

GetContact function

Retrieves a Contact from your Account.

IContactPtr GetContact(_bstr_t ContactID);

Parameters

  • ContactID The Id of Contact you want to retrieve.

Return Value: The Contact.

GetGroup function

Retrieves a Contact Group from your Account.

IGroupPtr GetGroup (_bstr_t GroupID);

Parameters

  • GroupID The Id of the Contact Group you want to retrieve.

Return Value: The Contact Group.

GetGroupMembers function

Retrieves the Contact members within a Contact Group.

IObjectCollectionPtr GetGroup (_bstr_t GroupID);

Parameters

  • GroupID The Id of the Contact Group whose members you want to retrieve.

Return Value: A collection containing the Contact Group’s members.

GetContactByQuickName function

Retrieves a Contact using it’s QuickName.

IContactPtr GetContact(_bstr_t QuickName);

Parameters

  • QuickName The QuickName of the Contact you want to retrieve.

Return Value: The Contact.

GetGroupByName function

Retrieves a Contact Group from your Account.

IGroupPtr GetGroup (_bstr_t GroupName);

Parameters

  • GroupName The name of the Contact Group you want to retrieve.

Return Value: The Contact Group.

Messenger Sample

The Messenger folder contains an MFC dialog application (EsendexMessenger.sln) that displays the contents of your Esendex Inbox. You can delete Messages from your Inbox and send an SMS Message.

Application flow is as follows:

  • stdafx.h contains a line to import the Esendex type library.
  • CEsendexMessengerApp::InitInstance() is called by MFC to initialise the application.
  • AfxOleInit() to the application’s InitInstance() method. This initialises the COM subsystem.
  • A CLoginDialog is instantiated and displayed to enable the user to enter Account information. The details are stored in CInboxApp ready for calls to the Esendex service.
  • A CLoginDialog is instantiated and displayed to show the contents of the user’s Inbox.
  • MFC calls CInboxDlg::OnInitDialog to show the dialog box.
  • InitialiseInboxService() is called to create the Esendex Inbox component.
  • PopulateList() is called to add the contents of the user’s Inbox to the list view control. At this point, the Account information entered by the user is used in the GetMessages method call. If the Account information is incorrect, and error message is displayed. The user should then use the Account button to re-enter their information.
  • The OnAccount(), OnSend(), OnSendFull(), OnDelete(), and OnRefresh() methods are called by MFC in response to the user clicking relevant buttons on the dialog box.