{ "info": { "author": "Evan Leis", "author_email": "engineergod@yahoo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Python API wrapper for Kayako 4.01.240\n--------------------------------------\n \n**Usage:**\n\nSet up the API::\n\n\t>>> from kayako import KayakoAPI, \n\t>>> API_URL = 'http://example.com/api/index.php'\n\t>>> API_KEY = 'abc3r4f-alskcv3-kvj4'\n\t>>> SECRET_KEY = 'vkl239vLKMNvlik42fv9IsflkFJlkckfjs'\n\t>>> api = KayakoAPI(API_URL, API_KEY, SECRET_KEY)\n\nAdd a department::\n\t\n\t>>> from kayako import Department\n\t>>>\n\t>>> # The following is equivalent to: department = api.create(Department, title='Customer Support Department', type='public', module='tickets'); department.add()\n\t>>> department = api.create(Department)\n\t>>> department.title = 'Customer Support Department'\n\t>>> department.type = 'public'\n\t>>> department.module = 'tickets'\n\t>>> department.add()\n\t>>> department.id\n\t84\n\t>>>\n\t>>> # Cool, we now have a ticket department.\n\t>>> # Lets say we want to make it private now\n\t>>>\n\t>>> department.type = 'private'\n\t>>> department.save()\n\t>>>\n\t>>> # Ok, great. Lets delete this test object.\n\t>>>\n\t>>> department.delete()\n\t>>> department.id\n\tUnsetParameter()\n\t>>>\n\t>>> # We can re-add it if we want to...\n\t>>>\n\t>>> department.save()\n\t>>> department.id\n\t85\n\t>>>\n\t>>> # Lets see all of our Departments (yours will vary.)\n\t>>> for dept in api.get_all(Department):\n\t... print dept\n\t... \n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t>>>\n\t>>> # Lets see all of our ticket Departments\n\t>>>\n\t>>> for dept in api.filter(Department, module='tickets')\n\t>>> print dept\n\t\n\t\n\t\n\t\n\t\n\t\n\t>>>\n\t>>> # We will use this Department in the next example so lets wait to clean up the test data...\n\t>>> #department.delete()\n\nAdd a Staff member::\n\n\t>>> from kayako import Staff, StaffGroup\n\t>>>\n\t>>> # You can set parameters in the create method.\n\t>>> staff = api.create(Staff, firstname='John', lastname='Doe', email='foo@example.com', username='explodes', password='easypass332') \n\t>>>\n\t>>> # We need to add a Staff member to a staff group.\n\t>>> # Lets get the first StaffGroup titled \"Administrator\"\n\t>>>\n\t>>> admin_group = api.first(StaffGroup, title=\"Administrator\")\n\t>>> staff.staffgroupid = admin_group.id\n\t>>>\n\t>>> # And save the new Staff\n\t>>>\n\t>>> staff.add()\n\t>>>\n\t>>> # We will use this Staff in the next example so lets wait to clean up the test data...\n\t>>> #staff.delete()\n\t\nAdd a User::\n\n\t>>> from kayako import User, UserGroup, FOREVER\n\t>>>\n\t>>> # What fields can we add to this User?\n\t>>> User.__add_parameters__\n\t['fullname', 'usergroupid', 'password', 'email', 'userorganizationid', 'salutation', 'designation', 'phone', 'isenabled', 'userrole', 'timezone', 'enabledst', 'slaplanid', 'slaplanexpiry', 'userexpiry', 'sendwelcomeemail']\n\t>>>\n\t>>> # Lets make a new User, but not send out a welcome email.\n\t>>> # Lets add the User to the \"Registered\" user group.\n\t>>> registered = api.first(UserGroup, title='Registered')\n\t>>> user = api.create(User, fullname=\"Ang Gary\", password=\"easypass332\", email=\"bar@example.com\", usergroupid=registered.id, sendwelcomeemail=False, phone='1-800-555-5555', userexpiry=FOREVER)\n\t>>> user.add()\n\t>>>\n\t>>> # Its that easy. We will use this user in the next example so lets wait to clean up the test data...\n\t>>> # user.delete()\n\t\nAdd a Ticket and a TicketNote::\n\n\t>>> from kayako import TicketStatus, TicketPriority, TicketType, TicketNote, TicketAttachment\n\t>>>\n\t>>> # Lets add a \"Bug\" Ticket to any Ticket Department, with \"Open\" status and \"High\" priority for a user. Lets use the user and department from above.\n\t>>>\n\t>>> bug = api.first(TicketType, title=\"Bug\")\n\t>>> open = api.first(TicketStatus, title=\"Open\")\n\t>>> high = api.first(TicketPriority, title=\"High\")\n\t>>>\n\t>>> ticket = api.create(Ticket, tickettypeid=bug.id, ticketstatusid=open.id, ticketpriorityid=high.id, departmentid=department.id, userid=user.id)\n\t>>> ticket.subject = 'I found a bug and its making me very angry.'\n\t>>> ticket.fullname = 'Ang Gary'\n\t>>> ticket.email = 'bar@example.com'\n\t>>> ticket.contents = 'I am an angry customer you need to make me happy.'\n\t>>> ticket.add()\n\t>>>\n\t>>> # The ticket was added, lets let the customer know that everything will be fine.\n\t>>>\n\t>>> print 'Thanks, %s, your inquiry with reference number %s will be answered shortly.' % (ticket.fullname, ticket.displayid)\n\tThanks, Ang Gary, your inquiry with reference number TOJ-838-99722 will be answered shortly.'\n\t>>>\n\t>>> # Lets add a note to this Ticket, using the Staff member we created above.\n\t>>>\n\t>>> note = api.create(TicketNote, ticketid=ticket.id, contents='Customer was hostile. Will pursue anyway as this bug is serious.')\n\t>>> note.staffid = staff.id # Alternatively, we could do: staff.fullname = 'John Doe'\n\t>>> note.add()\n\t>>>\n\t>>> # Lets say the bug is fixed, we want to let the User know.\n\t>>>\n\t>>> post = api.create(TicketPost, ticketid=ticket.id, subject=\"We fixed it.\", contents=\"We have a patch that will fix the bug.\")\n\t>>> post.add()\n\t>>>\n\t>>> # Now lets add an attachment to this TicketPost.\n\t>>>\n\t>>> with open('/var/patches/foo.diff', 'rb') as patch:\n\t... binary_data = patch.read()\n\t>>>\n\t>>> attachment = api.create(TicketAttachment, ticketid=ticket.id, ticketpostid=post.id, filename='foo.diff', filetype='application/octet-stream')\n\t>>> attachment.set_contents(binary_data) # set_contents encodes data into base 64. get_contents decodes base64 contents into the original data.\n\t>>> attachment.add()\n\t>>>\n\t>>> # Lets clean up finally.\n\t>>> ticket.delete() # This deletes the attachment, post, and note.\n\t>>> user.delete()\n\t>>> staff.delete()\n\t>>> department.delete()\n\n**API Factory Methods:**\n\n``api.create(Object, *args, **kwargs)``\n\n Create and return a new ``KayakoObject`` of the type given passing in args and kwargs.\n \n``api.get_all(Object, *args, **kwargs)``\n\n *Get all ``KayakoObjects`` of the given type.*\n *In most cases, all items are returned.*\n \n e.x. ::\n \n >>> api.get_all(Department)\n [, ....]\n\n *Special Cases:*\n \n ``api.get_all(User, marker=1, maxitems=1000)``\n Return all ``Users`` from userid ``marker`` with up to ``maxitems`` \n results (max 1000.)\n \n ``api.get_all(Ticket, departmentid, ticketstatusid=-1, ownerstaffid=-1, userid=-1)``\n Return all ``Tickets`` filtered by the required argument \n ``departmentid`` and by the optional keyword arguments.\n \n ``api.get_all(TicketAttachment, ticketid)``\n Return all ``TicketAttachments`` for a ``Ticket`` with the given ID.\n \n ``api.get_all(TicketPost, ticketid)``\n Return all ``TicketPosts`` for a ``Ticket`` with the given ID.\n \n ``api.get_all(TicketCustomField, ticketid)``\n \tReturn all ``TicketCustomFieldGroups`` for a ``Ticket`` with the given ID.\n \tReturns a ``list`` of ``TicketCustomFieldGroups``.\n \t\n ``api.get_all(TicketCount)``\n \tReturns only one object: ``TicketCount`` not a ``list`` of objects.\n\n``api.filter(Object, args=(), kwargs={}, **filter)``\n\n\tGets all ``KayakoObjects`` matching a filter.\n \n e.x. ::\n\n >>> api.filter(Department, args=(2), module='tickets')\n [, , ...]\n \n``api.first(Object, args=(), kwargs={}, **filter)``\n\n\tReturns the first ``KayakoObject`` found matching a given filter.\n \n e.x. ::\n\n >>> api.filter(Department, args=(2), module='tickets')\n \n\n``api.get(Object, *args)``\n\n *Get a ``KayakoObject`` of the given type by ID.*\n \n e.x. ::\n\n >>> api.get(User, 112359)\n \n \n *Special Cases:*\n \n ``api.get(TicketAttachment, ticketid, attachmentid)``\n Return a ``TicketAttachment`` for a ``Ticket`` with the given ``Ticket``\n ID and ``TicketAttachment`` ID. Getting a specific ``TicketAttachment``\n gets a ``TicketAttachment`` with the actual attachment contents.\n \n ``api.get(TicketPost, ticketid, ticketpostid)``\n Return a ``TicketPost`` for a ticket with the given ``Ticket`` ID and\n ``TicketPost`` ID.\n \n ``api.get(TicketNote, ticketid, ticketnoteid)``\n Return a ``TicketNote`` for a ticket with the given ``Ticket`` ID and\n ``TicketNote`` ID.\n \n**Object persistence methods**\n\n``kayakoobject.add()``\n *Adds the instance to Kayako.*\n``kayakoobject.save()``\n *Saves an existing object the instance to Kayako.*\n``kayakoobject.delete()``\n *Removes the instance from Kayako*\n \nThese methods can raise exceptions:\n\n Raises ``KayakoRequestError`` if one of the following is true:\n - The action is not available for the object\n - A required object parameter is UnsetParameter or None (add/save)\n - The API URL cannot be reached\n \n Raises ``KayakoResponseError`` if one of the following is true:\n - There is an error with the request (not HTTP 200 Ok)\n - The XML is in an unexpected format indicating a possible Kayako version mismatch\n \n**Misc API Calls**\n\n``api.ticket_search(query, ticketid=False, contents=False, author=False, email=False, creatoremail=False, fullname=False, notes=False, usergroup=False, userorganization=False, user=False, tags=False)``\n\t*Search tickets with a query in the specified fields*\n \n**Changes**\n\n *1.1.5*\n \n\t\t- Fix ``Staff.__str__``.\n\t\t- ``Ticket.__str__`` includes ``displayid``.\n\t\t- ``TicketPost.subject`` is not returned in any responses, so it is not always available, removed it from ``TicketPost.__str__``.\n\n *1.1.4*\n\t\n\t\t- Requires Kayako 4.01.240, use 1.1.3 for Kayako 4.01.204\n\t\t- ``TicketNote`` now supports get and delete\n\t\t- Added ``api.ticket_search``, see Misc API Calls for details.\n\t\t- Refactored ticket module into ticket package. This could cause problems\n\t\t if things were not imported like ``from kayako.objects import X``\n\t\t- Added ``TicketCount`` object. Use ``api.get_all(TicketCount)`` to\n\t\t retrieve.\n\t\t- Added ``TicketTimeTrack`` object. ``api.get_all(TicketTimeTrack, ticket.id)`` or\n\t\t ``api.get(TicketTimeTrack, ticket.id, ticket_time_track_id)``\n\t\t- Added ``Ticket.timetracks``\n\n**Quick Reference**\n\n================= ====================================================================== ========================= ======= ======= =====================\nObject Get All Get Add Save Delete\n================= ====================================================================== ========================= ======= ======= =====================\nDepartment Yes Yes Yes Yes Yes\nStaff Yes Yes Yes Yes Yes\nStaffGroup Yes Yes Yes Yes Yes\nTicket departmentid, ticketstatusid= -1, ownerstaffid= -1, userid= -1 Yes Yes Yes Yes\nTicketAttachment ticketid ticketid, attachmentid Yes No Yes\nTicketCustomField ticketid No No No No\nTicketCount Yes No No No No\nTicketNote ticketid Yes Yes No Yes\nTicketPost ticketid ticketid, postid Yes No Yes\nTicketPriority Yes Yes No No No\nTicketStatus Yes Yes No No No\nTicketTimeTrack ticketid ticketid, id Yes No Yes\nTicketType Yes Yes No No No\nUser marker=1, maxitems=1000 Yes Yes Yes Yes\nUserGroup Yes Yes Yes Yes Yes\nUserOrganization Yes Yes Yes Yes Yes\n================= ====================================================================== ========================= ======= ======= =====================", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "Lesser GNU General Public License (LGPL)", "maintainer": null, "maintainer_email": null, "name": "kayako", "package_url": "https://pypi.org/project/kayako/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/kayako/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/kayako/1.1.5/", "requires_dist": null, "requires_python": null, "summary": "Python API Wrapper for Kayako 4.01.240", "version": "1.1.5" }, "last_serial": 722466, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5eaa9a6aaaeaaa9502413ecb831f3a0f", "sha256": "a0423fe7363f2610a06ba710f538d8ba808c4d514ee6a4679fc0171fe889762a" }, "downloads": -1, "filename": "kayako-1.0.tar.gz", "has_sig": false, "md5_digest": "5eaa9a6aaaeaaa9502413ecb831f3a0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21066, "upload_time": "2011-05-12T19:14:32", "url": "https://files.pythonhosted.org/packages/9e/5e/82c7d499115eb3ddcde3b2a3f7d98d37481d6027a3e6988f93073dc1831f/kayako-1.0.tar.gz" } ], "1.0.01": [ { "comment_text": "", "digests": { "md5": "6d7cc0cf92b7c7553e5e20b88aa3c7bc", "sha256": "6090fcbd5adcdc460d4b6f123c85f86db45b25f14aa6b3405fb195c2a8ff748f" }, "downloads": -1, "filename": "kayako-1.0.01.tar.gz", "has_sig": false, "md5_digest": "6d7cc0cf92b7c7553e5e20b88aa3c7bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21121, "upload_time": "2011-05-13T17:37:08", "url": "https://files.pythonhosted.org/packages/5e/46/a318dd604fdb4f8acf3868c87cdef67b3af11771367c19ad0103cf216ae8/kayako-1.0.01.tar.gz" } ], "1.0.02": [ { "comment_text": "", "digests": { "md5": "b9380ae0f9ccba4a2612a321b945c183", "sha256": "c74cde9be73a0d4480e665fec006bbe0aa786ff703ed867517860a5116b9bc80" }, "downloads": -1, "filename": "kayako-1.0.02.tar.gz", "has_sig": false, "md5_digest": "b9380ae0f9ccba4a2612a321b945c183", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23092, "upload_time": "2011-05-13T23:37:47", "url": "https://files.pythonhosted.org/packages/af/74/29ddf50d7c7e45a279f1b2eb481a48c895099c40432cc13bd808c8c3dc43/kayako-1.0.02.tar.gz" } ], "1.0.03": [ { "comment_text": "", "digests": { "md5": "835d4c989c2b4231eee4689abc4e32e1", "sha256": "f293915a1511548b64ec0b3c38e877a52c8fa30f6e0c5b0202c30fca0a29a880" }, "downloads": -1, "filename": "kayako-1.0.03.tar.gz", "has_sig": false, "md5_digest": "835d4c989c2b4231eee4689abc4e32e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23165, "upload_time": "2011-05-13T23:45:37", "url": "https://files.pythonhosted.org/packages/b8/29/b0cc0c18dd0e5bc1c2df07cbdb0926f40df8ed6d58a7a1295ff6bcb55f49/kayako-1.0.03.tar.gz" } ], "1.0.04": [ { "comment_text": "", "digests": { "md5": "f3e7277909684a8ab94b0b3403f16f96", "sha256": "a6e8ddca5c2ee8a4272c1eb9a4a11e241e77fa9042c79ae8ec3abce99c281f13" }, "downloads": -1, "filename": "kayako-1.0.04.tar.gz", "has_sig": false, "md5_digest": "f3e7277909684a8ab94b0b3403f16f96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23313, "upload_time": "2011-05-17T20:16:51", "url": "https://files.pythonhosted.org/packages/aa/27/04b9e476617b0d889423f72f329d51f8fef9443d923bfd330be01796842e/kayako-1.0.04.tar.gz" } ], "1.0.05": [ { "comment_text": "", "digests": { "md5": "a1096bce5e461de09be9c979cd062c25", "sha256": "823cdd74d58bd4ccea3aba398f6ec9a51a600351617eea72d6212c6e452f8a82" }, "downloads": -1, "filename": "kayako-1.0.05.tar.gz", "has_sig": false, "md5_digest": "a1096bce5e461de09be9c979cd062c25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23936, "upload_time": "2011-05-17T23:42:12", "url": "https://files.pythonhosted.org/packages/c8/37/50bc8754862da9974b77a8ae507133dd83d8273ef9bf80092698404840c2/kayako-1.0.05.tar.gz" } ], "1.1.01": [ { "comment_text": "", "digests": { "md5": "63dc33545d87df8ac570e4534652f628", "sha256": "7909799867b62419d2a193b22dec07ae2a7b56fe36ac555ca7b03d4b70ce38c2" }, "downloads": -1, "filename": "kayako-1.1.01.tar.gz", "has_sig": false, "md5_digest": "63dc33545d87df8ac570e4534652f628", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23998, "upload_time": "2011-05-18T00:20:24", "url": "https://files.pythonhosted.org/packages/17/9a/1274c7042c33dfab759c167f89c6e7514a4014b17e34d741708ca3582c28/kayako-1.1.01.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "5ea8f85524a8aa57d05094d7389a2dcf", "sha256": "131bbb2d9e66d233a0fad811fc42de309fc642d44bd78de5b5b0d63de5c893ca" }, "downloads": -1, "filename": "kayako-1.1.2.tar.gz", "has_sig": false, "md5_digest": "5ea8f85524a8aa57d05094d7389a2dcf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25393, "upload_time": "2011-05-24T19:22:34", "url": "https://files.pythonhosted.org/packages/b0/11/ee31c4d4af1716a92e847fed9e8b8b9ccf1c1cc7d209972bfbb6f13d7c10/kayako-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "68469510b72175d71ba46139a55c62a4", "sha256": "ef699995d00237e789f720ce5b138d8378db112ef997ed64b2394afc0f4e429e" }, "downloads": -1, "filename": "kayako-1.1.3.tar.gz", "has_sig": false, "md5_digest": "68469510b72175d71ba46139a55c62a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25450, "upload_time": "2011-05-26T00:39:41", "url": "https://files.pythonhosted.org/packages/9c/35/fa3a4eb1b474c4e9ed830c630eea64b5774fbd3afd126faead2d0f1d80f7/kayako-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "cd85b15e47e2c4ae58230d77d5a39c95", "sha256": "d5f9fa368c0706712d51f91f633c603eb2cc8dfb1a2e3a4d562b2a47d7ab93dd" }, "downloads": -1, "filename": "kayako-1.1.4.tar.gz", "has_sig": false, "md5_digest": "cd85b15e47e2c4ae58230d77d5a39c95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32369, "upload_time": "2011-06-10T23:07:39", "url": "https://files.pythonhosted.org/packages/bb/4e/4dade921a303ccfc1c33bb1a9f8a6de90f70666b3f39559f1004e5d75a70/kayako-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "04af6d8a7769bbac403823fd4f3e4fce", "sha256": "1dcf13f4b2ccc2be4d0e5e1a1ff6367ce88e882bc4b8be94d0202d535ca8be3a" }, "downloads": -1, "filename": "kayako-1.1.5.tar.gz", "has_sig": false, "md5_digest": "04af6d8a7769bbac403823fd4f3e4fce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32660, "upload_time": "2011-06-16T18:01:33", "url": "https://files.pythonhosted.org/packages/f8/db/8615de6ea26b2528e308b920368c9953da79108ce58d0820c1a857cbd56a/kayako-1.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04af6d8a7769bbac403823fd4f3e4fce", "sha256": "1dcf13f4b2ccc2be4d0e5e1a1ff6367ce88e882bc4b8be94d0202d535ca8be3a" }, "downloads": -1, "filename": "kayako-1.1.5.tar.gz", "has_sig": false, "md5_digest": "04af6d8a7769bbac403823fd4f3e4fce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32660, "upload_time": "2011-06-16T18:01:33", "url": "https://files.pythonhosted.org/packages/f8/db/8615de6ea26b2528e308b920368c9953da79108ce58d0820c1a857cbd56a/kayako-1.1.5.tar.gz" } ] }