• Français
    • Espagnol
    • Anglais
Contact : +33(0)4.13.41.50.70
  • Français
    • Espagnol
    • Anglais

Code source API SMS WINDEV

Fichier Main

cOctoPush is a Class
PRIVATE
_user_loginis string
_api_keyis string
_sms_tex is string
_sms_senderis string
_sms_typeis string
_sending_dateis string
_sms_modeis int
_sms_recipientsis string
_transactionalis boolean
_with_repliesis boolean

_url_simpleis string
_url_difereis string
_url_tranactionalis string
_url_withrepliesis string

END

PROCEDURE Constructor()

url_simple = « https://www.octopush-dm.com/api/sms/json?user_login=%1&api_key=%2&sms_recipients=%3&sms_text=%4&sms_type=%5&sms_sender=%6 »
url_difere = « https://www.octopush-dm.com/api/sms/json?user_login=%1&api_key=%2&sms_recipients=%3&sms_text=%4&sms_type=%5&sms_sender=%6&sms_mode=%7&sending_date=%8 »
url_tranactional = « https://www.octopush-dm.com/api/sms/json?user_login=%1&api_key=%2&sms_recipients=%3&sms_text=%4&sms_type=%5&sms_sender=%6&transactional=1 »
url_withreplies = « https://www.octopush-dm.com/api/sms/json?user_login=%1&api_key=%2&sms_recipients=%3&sms_text=%4&sms_type=%5&sms_sender=%6&with_replies=1 »

PROCEDURE Destructor()

PROCEDURE PRIVATE api_key() : string

RESULT _api_key
PROCEDURE PRIVATE api_key(Value is string)

_api_key=Value
PROCEDURE PRIVATE user_login() : string

RESULT _user_login
PROCEDURE PRIVATE user_login(Value is string)

_user_login=Value
PROCEDURE PRIVATE sms_text() : string

RESULT Gauche(_sms_text,459)
PROCEDURE PRIVATE sms_text(Value is string)

_sms_text=Value
PROCEDURE PRIVATE sms_sender() : string

RESULT _sms_sender
PROCEDURE PRIVATE sms_sender(Value is string)

_sms_sender=Value
PROCEDURE PRIVATE sms_type() : string

RESULT _sms_type
PROCEDURE PRIVATE sms_type(Value is string)

_sms_type=Value
PROCEDURE PRIVATE sending_date() : DateTime

RESULT _sending_date
PROCEDURE PRIVATE sending_date(Value is DateTime)

_sending_date=Value
PROCEDURE PRIVATE sms_mode() : int

RESULT _sms_mode
PROCEDURE PRIVATE sms_mode(Value is int)

_sms_mode=Value
PROCEDURE PRIVATE sms_recipients() : string

RESULT _sms_recipients
PROCEDURE PRIVATE sms_recipients(Value is string)

_sms_recipients=Value
PROCEDURE PRIVATE transactional() : boolean

RESULT _transactional
PROCEDURE PRIVATE transactional(Value is boolean)

_transactional=Value
PROCEDURE PRIVATE with_replies() : boolean

RESULT _with_replies
PROCEDURE PRIVATE with_replies(Value is boolean)

_with_replies=Value
PROCEDURE PRIVATE url_simple() : string

RESULT _url_simple
PROCEDURE PRIVATE url_simple(Value is string)

_url_simple=Value
PROCEDURE PRIVATE url_tranactional() : string

RESULT _url_tranactional
PROCEDURE PRIVATE url_tranactional(Value is string)

_url_tranactional=Value
PROCEDURE PRIVATE url_difere() : string

RESULT _url_difere
PROCEDURE PRIVATE url_difere(Value is string)

_url_difere=Value
PROCEDURE PRIVATE url_withreplies() : string

RESULT _url_withreplies
PROCEDURE PRIVATE url_withreplies(Value is string)

_url_withreplies=Value
// Summary: Mandatory verification
PROCEDURE PRIVATE sms_recipients_convert(psms_recipients is string):string

smsRecipients is string

smsRecipients = psms_recipients

//controle parametre obligatoire
smsRecipients=Remplace(smsRecipients, » « ,«  »)
smsRecipients=Remplace(smsRecipients,« / »,«  »)
smsRecipients=Remplace(smsRecipients,« -« ,«  »)
smsRecipients=Remplace(smsRecipients,« . »,«  »)

RESULT smsRecipients

// Summary: add +
PROCEDURE PRIVATE sms_text_convert(psms_text is string):string

sSMSText_Convert is string = psms_text

//SMS Text
sSMSText_Convert = Replace(sSMSText_Convert, » « ,« + »)

RESULT sSMSText_Convert

//Il s’agit de l’envoi simple de SMS. Vous pouvez spécifier plusieurs numéro de téléphone dans le paramètre « sms_recipients » en les séparant par une « , ».

PROCEDURE PUBLIC Octopush_send_Simple(puser_login is string=«  », pAPI_Key is string=«  », psms_text is string=«  », psms_recipients is string=«  », psms_type is string=«  », psms_sender is string=«  »)

sCodeTest