MSpacePESA USSD

MSpace Bulk SMS Service API Documentation


This page illustrates how you, a developer, a technical personnel or any form of our esteemed client can use our bulk SMS services with ease without necessarily logging into our web application. After this illustration you will be able to send texts, query SMS account balance and list your sub- account users in the system. This documentation assumes that you have subscribed for our bulk SMS services. If not please visit our website ‘www.mspace.co.ke’ or contact our offices to be assisted and be able to enjoy our services.

OverView of the API

Content


  1. Query SMS balance
  2. Send Text
  3. Query sub-account users
  4. Query Re-seller users
  5. System Login
  6. Re-seller client Top up
  7. sub-account users Top up

Overview


This is the get balance url = “ http://main_url/mspaceservice/wr/sms/balance /username={username}/password={password}”, where username is the value of your username and password the value of your password.

To get the IP to replace the main_url example kindly contact us.

Example:


http://main_url/mspaceservice/wr/sms/balance /username=myusername/password=mypassword

You can test this by pasting in your browser and press enter.

Response:


“your sms balance e.g. ‘50’” if you are a subscribed user or “Error 100: Authentication Failure” if your credentials are wrong.

NOTE that your URL format should support URL encoding UTF- 8 . Messages that are not properly formatted may be delivered with incorrectly encoded text or not delivered at all.

The request methods are summarized in the table below:

main_url = http://main_url/mspaceservice/wr/sms

Method Query SMS Balance
Url Structure main_url/balance/username={username}/password={password}
Url example http://main_url/balance/username=myusername/password=mypassword
Response on success Your current SMS balance e.g. “50”.
Response on failure Authentication failure for wrong user credentials or non-existing user.
Method Send Text
Url Structure main_url/sendtext/username={username}/password={password}/senderid={senderId}/recipient={recipient}/message={message}
Url example http://main_url/sendtext/username=myusername/password=mypassword/senderid=mysenderid/recipient=myrecipient/message=mymessage
Response on success Send action status and the sent message id i.e.“[{"messageId": "12345", "responseTime": "2018-06-2511:12:19:793", "status": "successful"}]”
Response on failure Athentication failure,Insufficient Balance, Invalid sender ID or internal service error.
Method Query sub-account users
Url Structure main_url/subusers/username={username}/password={password}
Url example http://main_url/subusers/username=myusername/password=mypassword
Response on success The username of your sub-account users and their SMS balances respectively i.e. “[{"smsBalance": "20", "subUserName": "subuser1"},{"smsBalance": "18", "subUserName": "subuser2"}]”“[]” if no subuser exists.
Response on failure Authentication failure.
Method Query Re-Seller users
Url Structure main_url/resellerclients/username={username}/password={password}
Url example http://main_url/resellerclients/username=myusername/password=mypassword
Response on success The username of your clients and their SMS balances respectively i.e. “[{"smsBalance": "20", "clientname": "client1"}, {"smsBalance": "18", "clientname": "client2"}]”
Response on failure Authentication failure.
Method Re-Seller users Top-up
Url Structure main_url/resellerclienttopup/username={username}/password={password} /clientname={clientname}/noofsms={noofsms}
Url example http://main_url/resellerclienttopup/username=myusername/password=mypassword/clientname={myclientname}/noofsms={noofsms}
Response on success Successful Top up of noOfSms SMS to clientname.
Response on failure Athentication failure, Insufficient Balance, You are not Authorized to make this transaction, indly Contact Providers for help, Failed to top up clientname account, Top up not Successful, Failed to deduct your account, or internal service error.
Method Sub-Account users Top-up
Url Structure main_url/subacctopup/username={username}/password={password}/subaccname={subaccname}/noofsms={noofsms}
Url example http://main_url/subacctopup/username=myusername/password=mypassword/subaccname={mysubaccname}/noofsms={noofsms}
Response on success Successful Top up of noOfSms SMS to subAccName.
Response on failure Athentication failure, Insufficient Balance,You are not Authorized to make this transaction,Kindly Contact Providers for help, Failed to top up subAccName account, Top up not Successful, failed to deduct your account, or internal service error.
Method System Login
Url Structure main_url/login/username={username}/password={password}
Url example http://main_url/login/username=myusername/password=mypassword
Response on success User exists.
Response on failure Authentication failure.

Kenya offices

+254722962934

Uganda offices

Elysee(Ntashart) Plaza, Kilimani Road, 2nd Floor Suite 4A

Kampala, Makerere Hill Road, Ham Towers, 3rd floor, Suite No HT 25