auth_token = "08eee0fc2c0bebf2132ddeaaaf173576" # Your Auth Token from www.twilio.com/console client = Client(account_sid, auth_token) message = client.messages.create(to="+14232404107", from_="+14232914011", body="A new support ticket is available!") print(message.sid) """ """ if "totalunresolveditems" in line[x]: sep = 'totalunresolveditems=' unresolved = line[n].split(sep, 1)[1] for dig in range(len(unresolved)): if unresolved[dig].isdigit() == False: unresolved[dig] = '' """ #from kayako import Ticket, TicketAttachment, TicketNote, TicketPost, TicketPriority, TicketStatus, TicketType from kayako import KayakoAPI API_URL = 'https://support.fused.com/api/' API_KEY = '0b85616f-556b-8234-6146-acafbe3d5552' SECRET_KEY = 'NDMwMGFiZDEtZmJiMC02NDE0LTE5MjMtNDJlMzI4MzExNmViODE2ZjUwMzMtMDA0Ny1lMmE0LTI5OGItZTg5ZjI1M2NkZTFh' api = KayakoAPI(API_URL, API_KEY, SECRET_KEY) print(api.get_all(TicketCount)) #print(api.get_all(Ticket, 5, ticketstatusid=4))
TicketAttachment, TicketNote, TicketStatus, TicketPriority) except ImportError: print "kayako not found" print "try: pip install kayako" PHONE_NUMBER_REGEXP = re.compile(r"^[\+]?\d{6,29}$")#{{{ """ The handle kApi is for communicating with the Kayako API respectively. """ kApi = KayakoAPI(KAYAKO_API_URL, KAYAKO_API_KEY, KAYAKO_SECRET_KEY) hApi = (HF_API_KEY, HF_AUTH_KEY)#}}} def getKayakoSignature():#{{{ """ This functions creates a random salt and hashes the salt with KAYAKO_SECRET_KEY. This is required only if directly calling the XML API of kayako instead of using the python API """ salt = ''.join([random.choice(string.ascii_letters+string.digits) for _ in range(30)]) signature = hmac.new(KAYAKO_SECRET_KEY, msg=salt, digestmod=hashlib.sha256).digest() encodedSignature = base64.b64encode(signature) return salt, encodedSignature#}}} def postToHappyFox(endpoint, payload, headers=None, files=None):#{{{