Skip to content

Trenalyze/trenalyze__python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trenalyze(PYTHON) V0.0.2

Author | Docs

Library Prerequisites

  1. Python >=3.6
  2. WhatsApp account.
  3. Active Token - Get a Token here.

Installation

Using PIP:

$ pip install trenalyze__python

In PYTHON:

Note: You'll need to Import the Trenalyze Python Library after installation

# Load the full build.
from trenalyze__python import Trenalyze

API

1. Creating an instance of the Trenalyze class.

# Creating an instance of the Trenalyze class.
trenalyze = Trenalyze()
Param Type Description
token string Use your Trenalyze Token from your Dashboard.
# Setting the API key for the Trenalyze API.
trenalyze.setToken(token)

Note: Phone number should be in the following format 12345678912, without or any other symbols

2. Initialize needed variables

Param Type Description
sender string Enter the WhatApp Number that has already been scanned on the Trenalyze Dashboard.
receiver string Phone number should be in the international format 2348157002782, without or any other symbols.
msgtext string Enter the desired text message to send.
mediaurl string (OPTIONAL). BUT MUST BE DECLARED This should be a valid media/file link. Learn More
buttons array (OPTIONAL). BUT MUST BE DECLARED You can attach quick replies buttons to your message. Learn More
debug boolean (OPTIONAL). Default is false. But you can set it to be true and the debug message is passed onto the console.
# Set the Required Parameters for sending a message 
sender =  'YOUR_WHATSAPP_NUMBER'
receiver = 'RECIPIENT_NUMBER'
msgtext = 'Hello World'
mediaurl = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'
buttons = [
    ['index' => 1, 'urlButton' => ['displayText' => 'Visit my website!', 'url' => 'https://trenalyze.com']],
    ['index' => 2, 'callButton' => ['displayText' => 'Call me!', 'phoneNumber' => ' 1 (234) 5678-9012']],
    ['index' => 3, 'quickReplyButton' => ['displayText' => 'This is a reply, just like normal buttons!', 'id' => 'id-like-buttons-message']]
]

NOTE: When not using mediaurl and buttons set to NULL

mediaurl =  ''
buttons =  ''

3. Send The Required Variables

trenalyze.setSender(sender)

trenalyze.setReceiver(receiver)

trenalyze.setMsgtext(msgtext)

NOTE: You can set Debug to True or False. It's False By default

trenalyze.setDebug(True)

4. Initialize SendMessage

# Initialize the send WhatsApp message functions
res = trenalyze.sendMessage()

print(res)

5. Sample Response

{
    'status': True, 
    'response': {
        'message': 'Messages sent successfully'
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages