Inviare messaggio vocale con Python
Invia un messaggio vocale a un gruppo di numeri di telefoni cellulari o fissi con Python
Python : DOCUMENTAZIONE API
- Creare gruppo con Python
- Prendere la lista di campo di gruppo con Python
- Aggiungere un campo ad un gruppo con Python
- Cancellare un campo da un gruppo con Python
- Eliminare un contatto da un gruppo
- Assegnare un paese ad un gruppo con Python
- Prendere la lista di contatti di un gruppo con Python
- Aggiungere contatti ad un gruppo con Python
- Modificare contatti di un gruppo con Python
- Cancellare contatti di un gruppo con Python
- Ottieni un elenco di canali di chat attivi con Python
- Invia un messaggio tramite chat con Python
- Invia un file tramite chat con Python
- Ottieni un elenco di conversazioni in una chat con Python
- Ottieni l'elenco dei messaggi da una chat con Python
- Ottieni un elenco di messaggi non letti da una chat con Python
Inviare messaggio vocale con Python
import urllib2
afilnet_class="voice"
afilnet_method="sendvoicetogroup"
afilnet_user="user"
afilnet_password="password"
afilnet_from="34900000000"
afilnet_countrycode="34"
afilnet_idgroup="1"
afilnet_message="sms+test"
afilnet_language="en"
afilnet_voice="Joanna"
afilnet_scheduledatetime=""
afilnet_output=""
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/?class="+afilnet_class+"&method="+afilnet_method+"&user="+afilnet_user+"&password="+afilnet_password+"&from="+afilnet_from+"&countrycode="+afilnet_countrycode+"&idgroup="+afilnet_idgroup+"&message="+afilnet_message+"&language="+afilnet_language+"&voice="+afilnet_voice+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output
result = urllib2.urlopen(sUrl).read()
from urllib.request import urlopen
from urllib.parse import urlencode
afilnet_class="voice"
afilnet_method="sendvoicetogroup"
afilnet_user="user"
afilnet_password="password"
afilnet_from="34900000000"
afilnet_countrycode="34"
afilnet_idgroup="1"
afilnet_message="sms+test"
afilnet_language="en"
afilnet_voice="Joanna"
afilnet_scheduledatetime=""
afilnet_output=""
# Create an URL request
sUrl = "https://www.afilnet.com/api/http/"
data = urlencode({"class": afilnet_class,"method": afilnet_method,"user": afilnet_user,"password": afilnet_password,"from": afilnet_from,"countrycode": afilnet_countrycode,"idgroup": afilnet_idgroup,"message": afilnet_message,"language": afilnet_language,"voice": afilnet_voice,"scheduledatetime": afilnet_scheduledatetime,"output": afilnet_output}).encode("utf-8")
result = urlopen(sUrl, data).read()
print(result)
import requests
afilnet_class="voice"
afilnet_method="sendvoicetogroup"
afilnet_user="user"
afilnet_password="password"
afilnet_from="34900000000"
afilnet_countrycode="34"
afilnet_idgroup="1"
afilnet_message="sms+test"
afilnet_language="en"
afilnet_voice="Joanna"
afilnet_scheduledatetime=""
afilnet_output=""
# Create an URL request
sUrl = "https://www.afilnet.com/api/basic/?class="+afilnet_class+"&method="+afilnet_method+"&from="+afilnet_from+"&countrycode="+afilnet_countrycode+"&idgroup="+afilnet_idgroup+"&message="+afilnet_message+"&language="+afilnet_language+"&voice="+afilnet_voice+"&scheduledatetime="+afilnet_scheduledatetime+"&output="+afilnet_output
result = requests.get(sUrl,auth=requests.auth.HTTPBasicAuth(afilnet_user,afilnet_password))
print(result.text)
Impostazione | Descrizione | Obbligatorio / Opzionale |
---|---|---|
class=voice | Classe alla quale si realizza la richiesta | Obbligatorio |
method=sendvoicetogroup | Metodo della classe alla quale si realizza la richiesta | Obbligatorio |
user | L’utente / email del suo conto Afilnet | Obbligatorio |
password | La password del suo conto Afilnet | Obbligatorio |
from | Mittente della chiamata vocale, deve essere un numero di telefono, se è incluso un mittente non accettato, la chiamata vocale verrà inviata con un mittente sconosciuto | Obbligatorio |
countrycode | Prefisso del paese | Obbligatorio |
idgroup | Identificatore di gruppo contenente i contatti a cui verrà inviata la chiamata vocale | Obbligatorio |
message | Messaggio da riprodurre con la voce nella chiamata vocale | Obbligatorio |
language | Lingua in cui verrà riprodotta la chiamata vocale, controllare la tabella allegata per vedere i valori disponibili | Opzionale |
voice | Voce con cui verrà riprodotta la chiamata vocale, controllare la tabella allegata per vedere i valori disponibili | Opzionale |
scheduledatetime | Data e ora di spedizione nel formato aaaa-mm-gg hh:mm:ss | Opzionale |
output | Formato di uscita del risultato | Opzionale |
Al realizzare richieste ricevera i seguenti campi:
- status
-
result (si status=success), ricevera i seguenti valori:
- id
- count
- credits
-
destinations
- messageid
- destination
- error (si status=error), qui ricevera il codice errore
I possibili codici di errore sono i seguenti:
Codice | Descrizione |
---|---|
MISSING_USER | Utente / email non aggiunta |
MISSING_PASSWORD | Password non aggiunta |
MISSING_CLASS | Categoria non inclusa |
MISSING_METHOD | Metodo non incluso |
MISSING_COMPULSORY_PARAM | Impostazione obbligatoria non inclusa |
INCORRECT_USER_PASSWORD | Utente o password incorretti |
INCORRECT_CLASS | Categoria incorretta |
INCORRECT_METHOD | Metodo incorretto |
NOT_ACCESS_TO_GROUP | Non disponi di permessi per il gruppo indicato |
NO_CREDITS | Il tuo saldo non e sufficiente |
Impostazioni.
- class : voice
- method : sendvoicetogroup
- user : user
- password : password
- from : 34900000000
- countrycode : 34
- idgroup : 1
- message : sms+test
- language : en
- voice : Joanna
- scheduledatetime :
- output :
Richiesta:
https://www.afilnet.com/api/http/?class=voice&method=sendvoicetogroup&user=user&password=password&from=34900000000&countrycode=34&idgroup=1&message=sms+test&language=en&voice=Joanna&scheduledatetime=&output=
ALLEGATO: Elenco delle lingue e delle voci per le chiamate vocali disponibili
In questo allegato troverai tutte le possibili combinazioni di lingue e voci che puoi utilizzare durante l'invio di messaggi di chiamata vocale
linguaggio (language) | Genere | Nome (voice) |
---|---|---|
ar | female | Hoda |
ar | male | Naayf |
ar | male | Tarik |
ar | female | Zeina |
ar | female | Aisha |
ar | male | Farooq |
ar | male | Hussein |
ar | female | Amal |
bg | male | Ivan |
bn | female | Sushmita |
bn | male | Sayan |
ca | female | Conchita |
ca | female | Herena |
ca | female | Montserrat |
cs | male | Jakub |
da | female | Naja |
da | female | Helle |
da | male | Mads |
de | male | Hans |
de | female | Hedda |
de | female | Marlene |
de | male | Stefan |
de | female | Angela |
de | female | Vicki |
de-at | male | Michael |
de-ch | male | Karsten |
el | male | Stefanos |
el | female | Afroditi |
el | female | Sophia |
en | female | Jessica |
en | male | Joey |
en | female | Joanna |
en | female | Jane |
en | female | Ivy |
en | male | Guy |
en | male | Benjamin |
en | female | Kimberly |
en | male | Matthew |
en | female | Kendra |
en | female | Salli |
en | female | Zira |
en | male | Justin |
en-au | male | Russell |
en-au | female | Catherine |
en-au | female | Hayley |
en-au | female | Nicole |
en-ca | female | Alice |
en-ca | female | Heather |
en-gb | female | Rosie |
en-gb | female | Hazel |
en-gb | male | George |
en-gb | male | Brian |
en-gb | female | Amy |
en-gb | female | Emma |
en-gb-wls | male | Geraint |
en-ie | male | Sean |
en-in | female | Heera |
en-in | male | Ravi |
en-in | female | Raveena |
en-in | female | Priya |
en-in | female | Aditi |
es | male | Miguel |
es | female | Penelope |
es | female | Lupe |
es | male | Pablo |
es | male | Enrique |
es | female | Laura |
es | female | Linda |
es-ar | male | Diego |
es-cl | female | Francisca |
es-es | female | Lola |
es-mx | male | Raul |
es-mx | female | Mia |
es-mx | female | Hilda |
fi | female | Heidi |
fi | female | Milla |
fi | female | Evelin |
fr | female | Juliette |
fr | female | Celine |
fr | male | Mathieu |
fr | female | Lea |
fr | female | Hortense |
fr | male | Picart |
fr-ca | female | Chantal |
fr-ca | female | Harmonie |
fr-ca | female | Caroline |
fr-ch | male | Guillaume |
gu | male | Dinesh |
gu | female | Leela |
he | male | Asaf |
hi | female | Aadita |
hi | female | Kalpana |
hi | male | Hemant |
hr | male | Matej |
hu | male | Szabolcs |
id | male | Andika |
id | male | Arif |
id | female | Indah |
id | male | Reza |
id | female | Nurul |
is | male | Karl |
is | female | Dora |
it | male | Giorgio |
it | male | Cosimo |
it | male | Carla |
it | female | Bianca |
it | female | Lucia |
it | female | Gianna |
ja | female | Mizuki |
ja | male | Ichiro |
ja | female | Ayumi |
ja | male | Takumi |
ja | female | Haruka |
kn | female | Namratha |
kn | male | Shashank |
ko | female | Jina |
ko | female | Sumi |
ko | female | Yumi |
ko | female | Seoyeon |
ko | female | Heami |
ko | male | Himchan |
ko | male | Minho |
ml | female | Kirti |
ml | male | Vishnu |
ms | male | Rizwan |
nl | male | Ruben |
nl | female | Lotte |
nl | female | Hanna |
no | female | Hulda |
no | female | Liv |
pl | female | Paulina |
pl | female | Maja |
pl | male | Jan |
pl | male | Jacek |
pl | female | Ewa |
pt-br | female | Vitoria |
pt-br | male | Ricardo |
pt-br | female | Heloisa |
pt-br | male | Daniel |
pt-br | female | Camila |
pt-pt | male | Jeraldo |
pt-pt | female | Jacinda |
pt-pt | male | Henriques |
pt-pt | female | Amalia |
pt-pt | female | Abrielle |
pt-pt | female | Ines |
pt-pt | female | Helia |
pt-pt | male | Cristiano |
ro | female | Carmen |
ro | male | Andrei |
ru | female | Irina |
ru | female | Ekaterina |
ru | male | Maxim |
ru | male | Pavel |
ru | female | Tatyana |
sk | male | Filip |
sl | male | Lado |
sv | female | Astrid |
sv | female | Hedvig |
ta | male | Valluvar |
ta | male | Ganesh |
ta | female | Shruti |
te | male | Vijay |
te | female | Samantha |
te | female | Chitra |
th | male | Pattara |
th | female | Somsi |
tr | female | Filiz |
tr | female | Seda |
vi | female | Lien |
vi | male | Quan |
vi | male | Thao |
vi | female | Mai |
vi | male | An |
wls | female | Gwyneth |
zh-cn | female | Akemi |
zh-cn | male | Wang |
zh-cn | female | Lin |
zh-cn | female | Huihui |
zh-cn | male | Zhang |
zh-cn | female | Liu |
zh-cn | male | Huang |
zh-cn | male | Chen |
zh-cn | female | Zhiyu |
zh-cn | female | Yaoyao |
zh-cn | female | Lily |
zh-cn | male | Kangkang |
zh-tw | female | Hanhan |
zh-tw | female | Yating |
zh-tw | male | Zhiwei |