Send SMS API with Python

Script for automatically sending messages with API:

# - * - Coding: utf-8 - * -
import MySQLdb
import pycurl
import base64
Import Json

db = MySQLdb.connect (host = "xxx.xxx.x.xx", user = "xxxxxxx", passwd = "xxxxx", db = "xxxxxxx")

Cursor = db.cursor ()

Cursor.execute ("SELECT Days, QueryTime, Timeout, Name, Query, centrodb.LocalConsult.Description, Contact FROM centrodb.RegistryConsults LEFT-OUTER CONNECTION centrodb.LocalConsult ON centrodb.LocalConsult.Id = centrodb.RegistryConsults. & # 39; Local` centrodb.utentes ON centrodb.utentes.codigoutente = centrodb.RegistoConsultas.Utente LINKS OUTER JOIN centrodb.DiasSemana ON centrodb.DaysSemana.Id = centrodb.RegistoConsultasDiaSemana ")

myresult = cursor.fetchall ()

for line in my result:
Days = line[0]
                QueryTime = line[1]
                HourSaida = line[2]
                name = line[3]
                Query = line[4]
                Description = line[5]
                Contact = line[6]

if __name__ == "__main__":
#url API
url = "https://dashboard.360nrs.com/api/rest/sms"
usrPass = "xxxxxx: xxxxxxx"
data = json.dumps ({
to[Contato],
"from": "CPA",
"message": "test",
})
b64Val = base64.b64encode (usrPass)
Headers =["Accept:Application/json","Authorization:Basic %s"%b64Val]
c = pycurl.curl ()
c.setopt (pycurl.URL, url)
c.setopt (pycurl.HTTPHEADER, header)
c.setopt (pycurl.POST, 1)
c.setopt (pycurl.POSTFIELDS, data)
c.setopt (pycurl.SSL_VERIFYHOST, 0)
c.setopt (pycurl.SSL_VERIFYPEER, 0)
c.perform ()
http_code = c.getinfo (pycurl.HTTP_CODE)
print (http_code)

However, when running the script to send the message, this message appears in the terminal and the message is not sent to the contact present in the variable Contact:

Insert here the description of the picture

Can someone help?