{ "info": { "author": "Valerian Saliou", "author_email": "valerian@valeriansaliou.name", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python" ], "description": "# python-crisp-api\n\nThe Crisp API Python wrapper. Authenticate, send messages, fetch conversations, access your agent accounts from your Python code.\n\nCopyright 2018 Crisp IM SARL. See LICENSE for copying information.\n\n* **\ud83d\udcdd Implements**: [Crisp Platform - API ~ v1](https://docs.crisp.chat/api/v1/) at reference revision: 12/31/2017\n* **\ud83d\ude18 Maintainer**: [@valeriansaliou](https://github.com/valeriansaliou)\n\n## Usage\n\nInstall the library:\n\n```bash\npip install crisp-api\n```\n\nThen, import it:\n\n```python\nfrom crisp_api import Crisp\n```\n\nConstruct a new authenticated Crisp client with your `identifier` and `key` tokens.\n\n```python\nclient = Crisp()\n\nclient.authenticate(identifier, key)\n```\n\nThen, your client is ready to be consumed!\n\n## Authentication\n\nTo authenticate against the API, generate your session identifier and session key **once** using the [Crisp token generation utility](https://go.crisp.chat/account/token/). You'll get a token keypair made of 2 values.\n\n**Keep your token keypair values private, and store them safely for long-term use.**\n\nThen, add authentication parameters to your `client` instance right after you create it:\n\n```python\nclient = Crisp()\n\n# Authenticate to API (identifier, key)\n# eg. client.authenticate(\"13937834-f6ce-4556-ae4f-9e0c54faf038\", \"eb6c3623245521d7a6c35f5b29f3fa756e893f034ed551d84518961c5ff16dec\")\nclient.authenticate(identifier, key)\n\n# Now, you can use authenticated API sections.\n```\n\n**\ud83d\udd34 Important: Make sure to generate your token once, and use the same token keys in all your subsequent requests to the API. Do not generate too many tokens, as we may invalidate your older tokens to make room for newer tokens.**\n\n## Resource Methods\n\nMost useful available Crisp API resources are implemented. **Programmatic methods names are named after their label name in the [API Reference](https://docs.crisp.chat/api/v1/)**.\n\nThus, it is straightforward to look for them in the library while reading the [API Reference](https://docs.crisp.chat/api/v1/).\n\nIn the following method prototypes, `crisp` is to be replaced with your Crisp API instance. For example, instanciate `client = Crisp()` and then call eg: `client.website.list_conversations(website_id, 1)`.\n\nWhen calling a method that writes data to the API (eg. send a message with: `client.website.send_message_in_conversation()`), you need to submit it this way:\n\n```python\nwebsite_id = \"88972681-a00c-4b3b-a383-cab281636484\"\nsession_id = \"session_9df2a21e-f113-41d4-8ed2-bad8b49cafd1\"\n\nclient.website.send_message_in_conversation(\n website_id, session_id,\n\n {\n \"type\": \"text\",\n \"content\": \"This message was sent from python-crisp-api! :)\",\n \"from\": \"operator\",\n \"origin\": \"chat\"\n }\n)\n```\n\n### Website\n\n* **Website Conversations**\n * **List Conversations**: `client.website.list_conversations(website_id, page_number)`\n\n* **Website Conversation**\n * **Create A New Conversation**: `client.website.create_new_conversation(website_id, data)`\n * **Check If Conversation Exists**: `client.website.check_conversation_exists(website_id, session_id)`\n * **Get A Conversation**: `client.website.get_conversation(website_id, session_id)`\n * **Remove A Conversation**: `client.website.remove_conversation(website_id, session_id)`\n * **Initiate A Conversation With Existing Session**: `client.website.initiate_conversation_with_existing_session(website_id, session_id)`\n * **Get Messages In Conversation**: `client.website.get_messages_in_conversation(website_id, session_id, query)`\n * **Send A Message In Conversation**: `client.website.send_message_in_conversation(website_id, session_id, query)`\n * **Update A Message In Conversation**: `client.website.update_message_in_conversation(website_id, session_id, fingerprint, data)`\n * **Compose A Message In Conversation**: `client.website.compose_message_in_conversation(website_id, session_id, data)`\n * **Mark Messages As Read In Conversation**: `client.website.mark_messages_read_in_conversation(website_id, session_id, data)`\n * **Mark Messages As Delivered In Conversation**: `client.website.mark_messages_delivered_in_conversation(website_id, session_id, data)`\n * **Get Conversation Routing Assign**: `client.website.get_conversation_routing_assign(website_id, session_id)`\n * **Assign Conversation Routing**: `client.website.assign_conversation_routing(website_id, session_id, data)`\n * **Get Conversation Metas**: `client.website.get_conversation_metas(website_id, session_id)`\n * **Update Conversation Metas**: `client.website.update_conversation_metas(website_id, session_id, data)`\n * **List Conversation Pages**: `client.website.list_conversation_pages(website_id, session_id, page_number)`\n * **List Conversation Events**: `client.website.list_conversation_events(website_id, session_id, page_number)`\n * **Get Conversation State**: `client.website.get_conversation_state(website_id, session_id)`\n * **Change Conversation State**: `client.website.change_conversation_state(website_id, session_id, data)`\n * **Get Block Status For Conversation**: `client.website.get_block_status_for_conversation(website_id, session_id)`\n * **Block Incoming Messages For Conversation**: `client.website.block_incoming_messages_for_conversation(website_id, session_id, data)`\n * **Request Email Transcript For Conversation**: `client.website.request_email_transcript_for_conversation(website_id, session_id, data)`\n\n* **Website People**\n * **Get People Statistics**: `client.website.get_people_statistics(website_id)`\n * **List People Segments**: `client.website.list_people_segments(website_id, page_number)`\n * **List People Profiles**: `client.website.list_people_profiles(website_id, page_number)`\n * **Add New People Profile**: `client.website.add_new_people_profile(website_id, data)`\n * **Check If People Profile Exists**: `client.website.check_people_profile_exists(website_id, people_id)`\n * **Get People Profile**: `client.website.get_people_profile(website_id, people_id)`\n * **Save People Profile**: `client.website.save_people_profile(website_id, people_id, data)`\n * **Update People Profile**: `client.website.update_people_profile(website_id, people_id, data)`\n * **Remove People Profile**: `client.website.remove_people_profile(website_id, people_id)`\n * **List People Conversations**: `client.website.list_people_conversations(website_id, people_id, page_number)`\n + **Add A People Event**: `client.website.add_people_event(website_id, people_id, data)`\n + **List People Events**: `client.website.list_people_events(website_id, people_id, page_number)`\n + **Get People Data**: `client.website.get_people_data(website_id, people_id)`\n + **Save People Data**: `client.website.save_people_data(website_id, people_id, data)`\n + **Get People Subscription Status**: `client.website.get_people_subscription_status(website_id, people_id)`\n + **Update People Subscription Status**: `client.website.update_people_subscription_status(website_id, people_id, data)`\n\n* **Website Base**\n * **Create Website**: `client.website.create_website(data)`\n * **Get A Website**: `client.website.get_website(website_id)`\n * **Delete A Website**: `client.website.delete_website(website_id)`\n\n* **Website Batch**\n * **Batch Resolve Items**: `client.website.batch_resolve_items(website_id, data)`\n * **Batch Read Items**: `client.website.batch_read_items(website_id, data)`\n * **Batch Remove Items**: `client.website.batch_remove_items(website_id, data)`\n\n* **Website Availability**\n * **Get Website Availability Status**: `client.website.get_website_availability_status(website_id)`\n\n* **Website Operator**\n * **List Website Operators**: `client.website.list_website_operators(website_id)`\n * **List Last Active Website Operators**: `client.website.list_last_active_website_operators(website_id)`\n\n* **Website Settings**\n * **Get Website Settings**: `client.website.get_website_settings(website_id)`\n * **Update Website Settings**: `client.website.update_website_settings(website_id, data)`\n\n* **Website Visitors**\n * **Count Visitors**: `client.website.count_visitors(website_id)`\n * **List Visitors**: `client.website.list_visitors(website_id, page_number)`\n\n### Bucket\n\n* **Bucket URL**\n * **Generate Bucket URL**: `client.bucket.generate_bucket_url(data)`\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/crisp-im/python-crisp-api", "keywords": "", "license": "MIT - http://opensource.org/licenses/mit-license.php", "maintainer": "", "maintainer_email": "", "name": "crisp-api", "package_url": "https://pypi.org/project/crisp-api/", "platform": "", "project_url": "https://pypi.org/project/crisp-api/", "project_urls": { "Homepage": "https://github.com/crisp-im/python-crisp-api" }, "release_url": "https://pypi.org/project/crisp-api/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "Crisp API Python.", "version": "1.1.1" }, "last_serial": 4862074, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b3277e73f0f7af63b315316254495e10", "sha256": "db08a97a76e8925bcb656cccae1b851083756aeea013a26155c9141828db4e39" }, "downloads": -1, "filename": "crisp-api-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b3277e73f0f7af63b315316254495e10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5019, "upload_time": "2018-01-04T09:28:59", "url": "https://files.pythonhosted.org/packages/aa/da/f8a224d8afffd2da5f13a860ad26f232a19ccc7371672823d00c97a1a346/crisp-api-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c42f1454140f3a3c70d45501956611e1", "sha256": "aba92ce6c902c9ee59dc8da63099a1dfc8b1726939c0c2d83ed222f0ee761035" }, "downloads": -1, "filename": "crisp-api-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c42f1454140f3a3c70d45501956611e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5007, "upload_time": "2018-01-04T09:29:50", "url": "https://files.pythonhosted.org/packages/14/19/5f0164718e6ed0544040b55d6ec15b05633b8221a3d699f76417100c2696/crisp-api-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "db64505d59885cff82293bc5dc9361db", "sha256": "f240a754ba78f1f98eeb5c57b2254ac64b8d38bafb9c31a7ba51b1f71abaa5cd" }, "downloads": -1, "filename": "crisp-api-1.0.2.tar.gz", "has_sig": false, "md5_digest": "db64505d59885cff82293bc5dc9361db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5000, "upload_time": "2018-01-04T14:26:41", "url": "https://files.pythonhosted.org/packages/41/2a/d9778822dc09b3fefb4c8db25126dcd9f154af789398f4f83ef6f0f012a3/crisp-api-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "6351788e435f16115b835a4cd87bf898", "sha256": "2875373d6f302417e0b24b5abdd25abf32ebec8fbeb165df51a72f9752b6df6f" }, "downloads": -1, "filename": "crisp-api-1.0.3.tar.gz", "has_sig": false, "md5_digest": "6351788e435f16115b835a4cd87bf898", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6356, "upload_time": "2018-01-25T15:53:48", "url": "https://files.pythonhosted.org/packages/84/fe/98c554ff9f5f913bf4a3d3ce94de5607adc6103eacda828cf8cc02fbd6b7/crisp-api-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "cd1d0f53ad0fdb40c2cada181fbe7b43", "sha256": "397843b5973714b8dc3a484c92d50f837af203b368ff70f103eaf9004227ada9" }, "downloads": -1, "filename": "crisp-api-1.0.4.tar.gz", "has_sig": false, "md5_digest": "cd1d0f53ad0fdb40c2cada181fbe7b43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6377, "upload_time": "2018-01-25T16:06:29", "url": "https://files.pythonhosted.org/packages/4b/e7/fd22691467bdb201a7db603469780c4aaa3ddd659094d37d92eb765983a7/crisp-api-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "8068978f7748d4089b9a5f2680c6136d", "sha256": "8fc788e208ae37c659b3589e72cc1e607334f66ca9c21301881e8e6006d75e11" }, "downloads": -1, "filename": "crisp-api-1.0.5.tar.gz", "has_sig": false, "md5_digest": "8068978f7748d4089b9a5f2680c6136d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6525, "upload_time": "2018-05-04T07:21:20", "url": "https://files.pythonhosted.org/packages/0b/31/f46e2e40a70e4524dbded9b550119dcb871cb37528439fdc0d198ef2d774/crisp-api-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "1900e8a8ebee3d9b9c80d24206ba55f9", "sha256": "dfe4d5ba5bc6eedc3e4639f004bb80722f8acf04e7aa30a035018aa78d83edf5" }, "downloads": -1, "filename": "crisp-api-1.0.6.tar.gz", "has_sig": false, "md5_digest": "1900e8a8ebee3d9b9c80d24206ba55f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6529, "upload_time": "2018-07-13T12:35:59", "url": "https://files.pythonhosted.org/packages/f3/d3/041c5a186fd7371b86f47c9287a2a7e286243751de9186b5da66c01035a7/crisp-api-1.0.6.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "9de95531c02bb221ae843043fc288170", "sha256": "9b3d21c7e54d7a05fac28530adcafcdddd55f6d30a53a36e1ab7a105535a3dde" }, "downloads": -1, "filename": "crisp-api-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9de95531c02bb221ae843043fc288170", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6246, "upload_time": "2018-08-15T08:39:22", "url": "https://files.pythonhosted.org/packages/68/db/3c135d29349d63c501f482787f1759f59e14911a9949d747646bee81d3ca/crisp-api-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "4b31470db520781722a33643c8c80d4b", "sha256": "f87d208296555c7a43705230ecf2c41672663870afd0a86ecff466c647ab9b64" }, "downloads": -1, "filename": "crisp-api-1.1.1.tar.gz", "has_sig": false, "md5_digest": "4b31470db520781722a33643c8c80d4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5831, "upload_time": "2019-02-24T21:48:29", "url": "https://files.pythonhosted.org/packages/96/c8/afd441d85c709e9c1236d888742ca05a31ff27c19197d764f438849a76fe/crisp-api-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4b31470db520781722a33643c8c80d4b", "sha256": "f87d208296555c7a43705230ecf2c41672663870afd0a86ecff466c647ab9b64" }, "downloads": -1, "filename": "crisp-api-1.1.1.tar.gz", "has_sig": false, "md5_digest": "4b31470db520781722a33643c8c80d4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5831, "upload_time": "2019-02-24T21:48:29", "url": "https://files.pythonhosted.org/packages/96/c8/afd441d85c709e9c1236d888742ca05a31ff27c19197d764f438849a76fe/crisp-api-1.1.1.tar.gz" } ] }