Skip to main content

Farapayamak REST and SOAP Webservice Wrapper (SDK)

Project description

Farapayamak Python

Introduction

Here we've provided a complete 3rd-party library (SDK) for Python developers that covers both SOAP and REST webservices. Before using, make sure you have provided a valid account in Farapayamak corporation.

معرفی

فراپیامک مجموعۀ کامل از متدهای اتصال به وب سرویس REST و SOAP این شرکت را برای توسعه دهندگان Python فراهم نموده. قبل از استفاده از این کتابخانه، نیاز به خرید پنل فراپیامک دارید

Installation

You can run the following pip command to have it:

pip install farapayamak

Usage

This is the simple usage for both REST and SOAP APIs:

restClient = Rest_Client('username', 'password')
print(restClient.SendSMS('09123456789', '5000xxx', 'test sms', false))

soapClient = Soap_Client('username', 'password')
print(soapClient.SendSimpleSMS2('09123456789', '5000xxx', 'test sms', false))

Further demonstrations can be found inside the rest-sample.py and soap-sample.py files.

REST or SOAP?

We support a small number of methods in REST against the SOAP web service that supports the entire ones.

REST Methods

We're currently supporting the following methods in REST web service:

restClient.SendSMS(to, _from, text, isFlash)
restClient.GetDeliveries2(recId)
restClient.GetMessages(location, _from, index, count)
restClient.GetCredit()
restClient.GetBasePrice()
restClient.GetUserNumbers()
restClient.BaseServiceNumber(text, to, bodyId)

SOAP Methods

We support a wide range of methods in SOAP web service. They're scope separated. Let's review all the SOAP web service methods.

Send Web Service

soapClient.GetCredit()
soapClient.GetDeliveries(recIds)
soapClient.GetDeliveries3(recId)
soapClient.GetSmsPrice(irancellCount, mtnCount, _from, text)
soapClient.SendByBaseNumber(text, to, bodyId)
soapClient.SendByBaseNumber2(text, to, bodyId)
soapClient.SendByBaseNumber3(text, to)
soapClient.SendSimpleSMS(to, _from, text, isflash)
soapClient.SendSimpleSMS2(to, _from, text, isflash)
soapClient.SendSms(to, _from, text, isflash, udh, recId)
soapClient.SendSms2(to, _from, text, isflash, udh, recId, status, filterId)
soapClient.SendMultipleSMS(to, _from, text, isflash, udh, recId)
soapClient.SendMultipleSMS2(to, _from, text, isflash, udh, recId)

Receive Web Service

soapClient.ChangeMessageIsRead(msgIds)
soapClient.GetInboxCount()
soapClient.GetLatestReceiveMsg(sender, receiver)
soapClient.GetMessages(location, _from, index, count)
soapClient.GetMessagesAfterID(location, _from, count, msgId)
soapClient.GetMessagesFilterByDate(location, _from, index, count, dateFrom, dateTo, isRead)
soapClient.GetMessagesReceptions(msgId, fromRows)
soapClient.GetMessagesWithChangeIsRead(location, _from, index, count, isRead, changeIsRead)
soapClient.GetOutBoxCount()
soapClient.RemoveMessages(location, msgIds)

User Web Service

soapClient.AddUser(productId, descriptions, mobileNumber, emailAddress, nationalCode, 
        name, family, corporation, phone, fax, address, postalCode, certificateNumber)
soapClient.AddUserWithLocation(productId, descriptions, mobileNumber, emailAddress, nationalCode, 
    name, family, corporation, phone, fax, address, postalCode, certificateNumber, country, province, city)
soapClient.AddUserWithMobileNumber(productId, mobileNumber, firstName, lastName, email)
soapClient.AddUserWithMobileNumber2(productId, mobileNumber, firstName, lastName, userName, email)
soapClient.AddUserWithUserNameAndPass(productId, descriptions, mobileNumber, emailAddress, nationalCode, 
    name, family, corporation, phone, fax, address, postalCode, certificateNumber, targetUserName, targetUserPassword)
soapClient.AuthenticateUser()
soapClient.ChangeUserCredit(amount, description, targetUsername, GetTax)
soapClient.DeductUserCredit(amount, description)
soapClient.ForgotPassword(mobileNumber, emailAddress, targetUsername)
soapClient.GetCities(provinceId)
soapClient.GetEnExpireDate()
soapClient.GetExpireDate()
soapClient.GetProvinces()
soapClient.GetUserBasePrice(targetUsername)
soapClient.GetUserCredit(targetUsername)
soapClient.GetUserCredit2()
soapClient.GetUserDetails(targetUsername)
soapClient.GetUserIsExist(targetUsername)
soapClient.GetUserNumbers()
soapClient.GetUserTransactions(targetUsername, creditType, dateFrom, dateTo, keyword)
soapClient.GetUserWallet()
soapClient.GetUserWalletTransaction(dateFrom, dateTo, count, startIndex, payType, payLoc)
soapClient.GetUsers()
soapClient.RemoveUser(targetUsername)

Voice Web Service

soapClient.SendBulkSpeechText(title, body, receivers, DateToSend, repeatCount)
soapClient.SendBulkVoiceSMS(title, voiceFileId, receivers, DateToSend, repeatCount)
soapClient.UploadVoiceFile(title, base64StringFile)

Contacts Web Service

soapClient.AddContact(groupIds, firstname, lastname, nickname, corporation, mobilenumber,
        phone, fax, birthdate, email, gender, province, city, address, postalCode, additionaldate,
        additionaltext, descriptions)
soapClient.AddContactEvents(contactId, eventName, eventType, eventDate)
soapClient.AddGroup(groupName, Descriptions, showToChilds)
soapClient.ChangeContact(contactId, firstname, lastname, nickname, corporation, mobilenumber,
        phone, fax, email, gender, province, city, address, postalCode, contactStatus,
        additionaltext, descriptions)
soapClient.ChangeGroup(groupId, groupName, Descriptions, showToChilds, groupStatus)
soapClient.CheckMobileExistInContact(mobileNumber)
soapClient.GetContactEvents(contactId)
soapClient.GetContacts(groupId, keyword, _from, count)
soapClient.GetContactsByID(contactId, status)
soapClient.GetGroups()
soapClient.MergeGroups(originGroupId, destinationGroupId, deleteOriginGroup)
soapClient.RemoveContact(mobilenumber)
soapClient.RemoveContactByContactID(contactId)
soapClient.RemoveGroup(groupId)

Schedule Web Service

soapClient.AddNewMultipleSchedule(to, _from, text, isflash, scheduleDateTime, period)
soapClient.AddNewUsance(to, _from, text, isflash, scheduleStartDateTime, countrepeat,
        scheduleEndDateTime, periodType)
soapClient.AddSchedule(to, _from, text, isflash, scheduleDateTime, period)
soapClient.GetScheduleDetails(scheduleId)
soapClient.GetScheduleStatus(scheduleId)
soapClient.RemoveSchedule(scheduleId)

Bulk Web Service

soapClient.AddNumberBulk(_from, title, messages, receivers, DateToSend)
soapClient.BulkReception(bulkId, maximumRows, startRowIndex)
soapClient.BulkReceptionCount(bulkId)
soapClient.GetBulkDeliveries(recIds)
soapClient.GetBulkDeliveries2(recId)
soapClient.GetBulkDetails(bulkdId)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

farapayamak-1.0.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

farapayamak-1.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file farapayamak-1.0.1.tar.gz.

File metadata

  • Download URL: farapayamak-1.0.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for farapayamak-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a01f55bff35a022bf50a0b96f9bd2edd70fa52dff387df226347baa90084a6ae
MD5 4ab82f9d0a9d3f3d9200a8c4a059b412
BLAKE2b-256 ae81d7e3d24c317377afb798b8f93ebfc9498edf6577b7fb57e6b9e0a176ba8f

See more details on using hashes here.

File details

Details for the file farapayamak-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: farapayamak-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for farapayamak-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7bb35616303b04f22d074ee2fa541b2c16bccf20f70c895c40037dc1ce853ce4
MD5 d7a9aeea847fd5440097b20610b413db
BLAKE2b-256 e8aea8ee5736032dbc4e55976eab0e4f269d140c52069023d529ebe19b462acb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page