diff --git a/HubSpot/HubSpot_Chat_about_your_last_deals.ipynb b/HubSpot/HubSpot_Chat_about_your_last_deals.ipynb new file mode 100644 index 0000000000..3c88b38a8d --- /dev/null +++ b/HubSpot/HubSpot_Chat_about_your_last_deals.ipynb @@ -0,0 +1,252 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d2e34832-b1e9-4cd1-ac74-a00dead5dc56", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "\"Naas\"" + ] + }, + { + "cell_type": "markdown", + "id": "182eb9cc-7fe5-4a96-9761-d1f631825a60", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "# HubSpot - Chat about your last deals" + ] + }, + { + "cell_type": "markdown", + "id": "639b3515-7d32-4382-a7d9-5f5fa85366ee", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Tags:** #hubspot #chat #deals #last #discussion #conversation" + ] + }, + { + "cell_type": "markdown", + "id": "4363e628-6e22-40d8-bd6a-06cf89c76d5a", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Author:** [Florent Ravenel](https://www.linkedin.com/in/florent-ravenel)" + ] + }, + { + "cell_type": "markdown", + "id": "a60ac146-ffa4-41e6-b7ba-d6447478e613", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Last update:** 2023-09-25 (Created: 2023-09-25)" + ] + }, + { + "cell_type": "markdown", + "id": "bb50c25d-1933-45d4-ae12-acf488bdf130", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**Description:** This notebook will help you to chat about your last deals with HubSpot. It will provide you with the necessary tools to discuss and analyze your deals." + ] + }, + { + "cell_type": "markdown", + "id": "106e2c3d-0618-4efa-8ed3-7ad6d87c4e6b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "**References:**\n- [HubSpot Documentation](https://knowledge.hubspot.com/articles/kcs_article/deals/how-to-use-deals-in-hubspot)\n- [HubSpot API Reference](https://developers.hubspot.com/docs/methods/deals/get_deals)" + ] + }, + { + "cell_type": "markdown", + "id": "21813711-0d2f-459b-b007-ba043e1db61f", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Input" + ] + }, + { + "cell_type": "markdown", + "id": "6b5c040d-7db5-4f35-a0b6-67585ce30982", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "acd4f387-37e0-48dd-83f6-58d53b0d23bb", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": "import requests\nimport json", + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "008aee68-01f6-45c0-8187-e0599bf94767", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Setup variables\n- **api_key**: API key to access HubSpot API. [How to get an API key?](https://knowledge.hubspot.com/articles/kcs_article/integrations/how-do-i-get-my-hubspot-api-key)\n- **deal_id**: ID of the deal to be discussed" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "82eced2a-b85e-46ac-a0b4-605eb6cb54c8", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": "api_key = \"\"\ndeal_id = \"\"", + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "c057ab90-3977-4dd8-84c4-e2e076b4c8d7", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Model" + ] + }, + { + "cell_type": "markdown", + "id": "6455b000-444d-4a6d-bb23-5256a580d057", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Get deal information" + ] + }, + { + "cell_type": "markdown", + "id": "99603978-853d-4270-ac58-63c42b6cfa6d", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "Retrieve the deal information from HubSpot API." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e118fe6b-eb64-4418-9f78-adc15355e49d", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": "url = f\"https://api.hubapi.com/deals/v1/deal/{deal_id}?hapikey={api_key}\"\nresponse = requests.get(url)\ndeal_info = json.loads(response.text)", + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "7e594ca8-f96c-4fb0-9f92-941fddc5060b", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "## Output" + ] + }, + { + "cell_type": "markdown", + "id": "5b3c917f-9545-40a0-b2e3-6b99ed027de2", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + "### Display result" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bab6640a-8da8-4637-be33-734f1c09d3b6", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": "print(deal_info)", + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "fb39a75e-176a-41c3-a394-2988b49b80e3", + "metadata": { + "papermill": {}, + "tags": [] + }, + "source": [ + " " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file