{ "info": { "author": "Lelia Rubiano", "author_email": "lrubiano5@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# hubspot-python\nHubSpot API wrapper written in Python.\n\n## Installing\n\n```\npip install hubspot-python\n```\n\n## Requirements\n\n```\n- requests\n```\n\n## Usage\n\n#### Client instantiation\n```\nfrom hubspot.client import Client\nclient = Client(APP_ID, HAPIKEY, CLIENT_ID, CLIENT_SECRET)\n```\n\n### Calendar\n#### Create a new calendar task\n```\ndata = {\n \"eventDate\": 1425760557000,\n \"category\": \"BLOG_POST\",\n \"state\": \"TODO\",\n \"campaignGuid\": \"f43fe9fd-4082-4a45-93d8-cb8a88f01654\",\n \"name\": \"Test Blog Task With topics 3\",\n \"description\": \"Cool Post with Topics\",\n \"ownerId\": 13316,\n \"topicIds\": [\n 330075656\n ],\n \"contentGroupId\": 343029322\n}\nresponse = client.calendar.create_task(data)\n```\n### Companies\n#### Get all companies\n```\nresponse = client.companies.get_companies(data)\n```\n\n#### Create a Company\n```\ndata = {\n \"name\": \"A company name\",\n \"description\": \"A company description\"\n}\nresponse = client.companies.create_company(data)\n```\n\n#### Delete a Company\n```\nresponse = client.companies.delete_company(COMPANY_ID)\n```\n\n#### Get Recently Created Companies\n```\nresponse = client.companies.get_recently_created_companies()\n```\n\n#### Get a Company\n```\nresponse = client.companies.get_company(COMPANY_ID)\n```\n\n### Contact Lists\n#### Get contact lists\n```\nresponse = client.contact_lists.get_contact_lists()\n```\n\n#### Create a new contact list\n```\ndata = {\n \"name\": \"tweeters\",\n \"dynamic\": true,\n \"portalId\": 62515,\n \"filters\": \n [\n [{\n \"operator\": \"EQ\",\n \"value\": \"@hubspot\",\n \"property\": \"twitterhandle\",\n \"type\": \"string\"\n }]\n ]\n}\nresponse = client.contact_lists.create_contact_list(data)\n```\n\n#### Delete a contact list\n```\nresponse = client.contact_lists.delete_contact_list(CONTACT_LIST_ID)\n```\n\n#### Get recently added contacts from a list\n```\nresponse = client.contact_lists.get_recently_added_contacts_in_a_list()\n```\n\n#### Get a contact list by its unique ID\n```\nresponse = client.contact_lists.get_contact_list(CONTACT_LIST_ID)\n```\n\n#### Add existing contacts to a list\n```\ndata = {\n \"vids\": [\n 3057124,\n\t5524274\n ],\n \"emails\": [\n \"testingapis@hubspot.com\"\n ]\n}\nresponse = client.contact_lists.add_contact_to_list(CONTACT_LIST_ID, data)\n```\n\n### Contacts\n#### Get all contacts\n```\nresponse = client.contacts.get_contacts()\n```\n\n#### Create a new contact\n```\ndata = {\n \"email\": \"testingapis@hubspot.com\",\n \"firstname\": \"Adrian\",\n \"lastname\": \"Mott\",\n \"website\": \"http://hubspot.com\",\n \"company\": \"HubSpot\",\n \"phone\": \"555-122-2323\",\n \"address\": \"25 First Street\",\n \"city\": \"Cambridge\",\n \"state\": \"MA\",\n \"zip\": \"02139\",\n}\nresponse = client.contacts.create_contact(data)\n```\n\n#### Delete a contact\n```\nresponse = client.contacts.delete_contact(CONTACT_ID)\n```\n\n#### Get recently created contacts\n```\nresponse = client.contacts.get_recently_created_contacts()\n```\n\n#### Get a contact list by its unique ID\n```\nresponse = client.contacts.get_contact(CONTACT_ID)\n```\n\n### Deals\n#### Get all deals\n```\nresponse = client.deals.get_deals()\n```\n\n#### Create a Deal\n```\ndata = {\n \"dealname\": \"Tim's Newer Deal\",\n \"dealstage\": \"appointmentscheduled\",\n \"pipeline\": \"default\",\n \"hubspot_owner_id\": \"24\",\n \"closedate\": 1409443200000,\n \"amount\": \"60000\",\n \"dealtype\": \"newbusiness\",\n}\nresponse = client.deals.create_deal(data)\n```\n\n#### Delete a Deal\n```\nresponse = client.deals.delete_deal(DEAL_ID)\n```\n\n#### Get Recently Created Deals\n```\nresponse = client.deals.get_recently_created_deals()\n```\n\n#### Get a contact list by its unique ID\n```\nresponse = client.deals.get_deal(DEAL_ID)\n```\n\n### Fields (Properties)\n#### Get all fields\n```\nresponse = client.fields.get_fields(MODULE)\n```\n\n### Integrations\n#### Get all fields\n```\nresponse = client.integrations.get_account_details()\n```\n\n#### Get all fields\n```\nresponse = client.integrations.get_daily_api_usage()\n```\n\n### Webhooks\n#### Viewing Settings\n```\nresponse = client.webhooks.get_settings()\n```\n\n#### Updating Settings\n```\ndata = {\n \"webhookUrl\": \"https://testing.com/webhook-modified\", \n \"maxConcurrentRequests\": 25\n}\n\nresponse = client.webhooks.update_settings(data)\n```\n\n#### Get Subscriptions\n```\nresponse = client.webhooks.get_subscriptions()\n```\n\n#### Create a New Subscription\n```\ndata = { \n \"subscriptionDetails\" : {\n \"subscriptionType\" : \"company.propertyChange\", \n \"propertyName\" : \"companyname\" \n }, \n \"enabled\": False\n}\n\nresponse = client.webhooks.create_subscription(data)\n```\n\n#### Update a Subscription\n```\ndata = { \n \"enabled\": False\n}\n\nresponse = client.webhooks.create_subscription(SUBSCRIPTION_ID, data)\n```\n\n#### Delete a Subscription\n```\nresponse = client.webhooks.delete_subscription(SUBSCRIPTION_ID)\n```\n\n### Workflows\n#### Get workflows\n```\nresponse = client.workflows.get_workflows()\n```\n\n#### Get workflow\n```\nresponse = client.workflows.get_workflow(WORKFLOW_ID)\n```\n\n#### Create a workflow\n```\ndata = {\n \"name\": \"Test Workflow\",\n \"type\": \"DRIP_DELAY\",\n \"onlyEnrollsManually\": true,\n \"actions\": [\n {\n \"type\": \"DELAY\",\n \"delayMillis\": 3600000\n },\n {\n \"newValue\": \"HubSpot\",\n \"propertyName\": \"company\",\n \"type\": \"SET_CONTACT_PROPERTY\"\n },\n {\n \"type\": \"WEBHOOK\",\n \"url\": \"https://www.myintegration.com/webhook.php\",\n \"method\": \"POST\",\n \"authCreds\": {\n \"user\": \"user\",\n \"password\": \"password\"\n }\n }\n ]\n}\nresponse = client.workflows.create_workflow(data)\n```\n\n#### Delete a Deal\n```\nresponse = client.workflows.delete_workflow(WORKFLOW_ID)\n```\n\n#### Enroll a contact into a workflow\n```\nresponse = client.workflows.enroll_a_contact_into_workflow(WORKFLOW_ID, EMAIL)\n```\n\n#### Unenroll a contact from a workflow\n```\nresponse = client.workflows.unenroll_a_contact_into_workflow(WORKFLOW_ID, EMAIL)\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GearPlug/hubspot-python.git", "keywords": "hubspot,crm", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "hubspot-python", "package_url": "https://pypi.org/project/hubspot-python/", "platform": "", "project_url": "https://pypi.org/project/hubspot-python/", "project_urls": { "Homepage": "https://github.com/GearPlug/hubspot-python.git" }, "release_url": "https://pypi.org/project/hubspot-python/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "HubSpot API written in python", "version": "1.0.0" }, "last_serial": 5689418, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e1dd7b04b50520714a8d73941729b7d7", "sha256": "fcaf818a4bf82835b55b3624b33dfc757154a2313fa0160516177084f7bf740d" }, "downloads": -1, "filename": "hubspot-python-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e1dd7b04b50520714a8d73941729b7d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3673, "upload_time": "2018-09-20T19:03:10", "url": "https://files.pythonhosted.org/packages/10/e5/26727a1db5f932ca2edd262d4238670cda9e8f6f7c8c1ad424a565cb2fbe/hubspot-python-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "e1ce4e38eb60354acbdcc9639dd81fff", "sha256": "22c7859cd51089f59450ffac3a2e7ed668ba7d24b050703cf2a194f776a1177a" }, "downloads": -1, "filename": "hubspot-python-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e1ce4e38eb60354acbdcc9639dd81fff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9663, "upload_time": "2019-08-16T20:36:57", "url": "https://files.pythonhosted.org/packages/91/e0/03bf6eaa439145fa2bf0b3c4dd2721c9d442b47d17040a035547b5863dfe/hubspot-python-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e1ce4e38eb60354acbdcc9639dd81fff", "sha256": "22c7859cd51089f59450ffac3a2e7ed668ba7d24b050703cf2a194f776a1177a" }, "downloads": -1, "filename": "hubspot-python-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e1ce4e38eb60354acbdcc9639dd81fff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9663, "upload_time": "2019-08-16T20:36:57", "url": "https://files.pythonhosted.org/packages/91/e0/03bf6eaa439145fa2bf0b3c4dd2721c9d442b47d17040a035547b5863dfe/hubspot-python-1.0.0.tar.gz" } ] }