From 97614249510380890b4951b7699e8cdf763f4eba Mon Sep 17 00:00:00 2001 From: Troy Taylor <44444967+troystaylor@users.noreply.github.com> Date: Mon, 19 Jul 2021 14:07:02 -0400 Subject: [PATCH] Hubspot CMS (#886) * certify-connector HubSpot CRM, CMS, and Marketing connectors * certify-connector Xero Accounting and Payroll connectors * Revert "certify-connector" This reverts commit 5fb06db7f3e0ea67bd7da4c55b729ff2395ddf68. * Revert "certify-connector" This reverts commit 160b208ed6202cb979f15eaae99eca33088faf88. * certify-connector * certify-connector * certify-connector * Update apiDefinition.swagger.json Fixed description * Update apiDefinition.swagger.json Cut to below 500 * Update apiDefinition.swagger.json Cut to below 500. * Delete icon.png * Delete settings.json * Delete independent-publisher-connectors/HubSpot CRM directory * Delete independent-publisher-connectors/HubSpot Marketing directory * Delete independent-publisher-connectors/Xero Accounting directory * Delete independent-publisher-connectors/Xero Payroll - UK directory * Delete independent-publisher-connectors/Xero Projects directory * Fix remaining descriptions, scope should be string * Fix clientId * apiProperties fix * Update apiProperties.json * Update README.md * Update README.md * Update apiProperties.json * Update apiProperties.json * Change connectionParameters to parameters * Update required scopes * Change to "redirectUrl": "https://global.consent.azure-apim.net/redirect" * Fixed scopes * Removed unused scopes * Fix hapikey * Removed API key connection * Removed security Co-authored-by: Mahbub Murshed Co-authored-by: Mahbub Murshed <48570820+mamurshe@users.noreply.github.com> --- .../HubSpot CMS/README.md | 46 ++ .../HubSpot CMS/apiDefinition.swagger.json | 551 ++++++++++++++++++ .../HubSpot CMS/apiProperties.json | 36 ++ 3 files changed, 633 insertions(+) create mode 100644 independent-publisher-connectors/HubSpot CMS/README.md create mode 100644 independent-publisher-connectors/HubSpot CMS/apiDefinition.swagger.json create mode 100644 independent-publisher-connectors/HubSpot CMS/apiProperties.json diff --git a/independent-publisher-connectors/HubSpot CMS/README.md b/independent-publisher-connectors/HubSpot CMS/README.md new file mode 100644 index 000000000..6abec328b --- /dev/null +++ b/independent-publisher-connectors/HubSpot CMS/README.md @@ -0,0 +1,46 @@ +# HubSpot CMS +HubSpot’s CMS platform has all the tools and integrations you need for marketing, sales, content management, and customer service. CMS Hub powers your website with a CMS that makes it easy to grow better. Developers build using flexible themes and content structures. Marketers easily edit and create pages on their own. Customers get a personalized, secure experience. + +## Publisher: Hitachi Solutions + +## Prerequisites +A paid or trial HubSpot account. + +## Getting Started +You will need to gather either an API key or OAuth credentials to use with this connector. + +## Obtaining Credentials +A HubSpot account (trial or paid) is needed for API key access. The API key is specific to a HubSpot account, not each user, and only one key is allowed at a time. The key can be found in Account Settings > Account Setup > Integrations > API Keys. More information can be found [here](https://knowledge.hubspot.com/articles/kcs_article/integrations/how-do-i-get-my-hubspot-api-key). + +A free HubSpot developer account is needed to install an OAuth app in your account for OAuth 2.0 access. Installed apps can be found in Account Settings > Account Setup > Integrations > Connected Apps. More information can be found [here](https://developers.hubspot.com/docs/api/working-with-oauth). + +## Supported Operations + +### Pages +#### List pages (V2) +Get all of your pages. +#### Create a new page (V2) +Create a new page. +#### Update a page (V2) +Updates a page in the database. If not all top level fields are included in the body, we will only update the included fields. +#### Delete a page (V2) +Marks a page as deleted. Returns 204 No Content letting you know that the page was successfully deleted. The page can be restored later via a POST to the restore-deleted endpoint. +#### Publish or unpublish a page (V2) +Either publishes or cancels publishing based on the POSTed JSON. + +### Templates +#### List templates (V2) +Get all templates. +#### Create a new template (V2) +Create a new coded template object in Design Manager. +#### Update the template (V2) +Updates a template. If not all the fields are included in the body, we will only update the included fields. +#### Delete the template (V2) +Marks the selected Template as deleted. The Template can be restored later via a POST to the restore-deleted endpoint. + +## Known Issues and Limitations +No issues and limitations are known at this time. + +## Frequently Asked Questions +### How do I obtain API key? +If you are not the HubSpot administrator for your account, check with the administrator before generating a new API key. If you have a HubSpot developer account connected to your company account, multiple OAuth apps can be installed in each company account. diff --git a/independent-publisher-connectors/HubSpot CMS/apiDefinition.swagger.json b/independent-publisher-connectors/HubSpot CMS/apiDefinition.swagger.json new file mode 100644 index 000000000..ddf238e26 --- /dev/null +++ b/independent-publisher-connectors/HubSpot CMS/apiDefinition.swagger.json @@ -0,0 +1,551 @@ +{ + "swagger": "2.0", + "info": { + "title": "HubSpot CMS", + "description": "This connector is used to retrieve and make changes to HubSpot CMS. HubSpot CMS is a SaaS CMS designed to help businesses grow their web presence with a special emphasis on enabling marketers. It is designed to be used on business websites where non-technical content creators need to be able to build, measure, and iterate on content independently while working within design, style, and functionality. The content, lead collection, and analytics are also integrated with the HubSpot CRM.", + "version": "1.0", + "contact": { + "name": "Troy Taylor", + "url": "https://www.hitachisolutions.com", + "email": "ttaylor@hitachisolutions.com" + } + }, + "host": "api.hubapi.com", + "basePath": "/", + "schemes": [ + "https" + ], + "consumes": [], + "produces": [], + "paths": { + "/content/api/v2/pages": { + "get": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "List pages (V2)", + "description": "Get all of your pages. Supports paging and filtering.", + "operationId": "PagesList", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "type": "integer", + "default": 20, + "description": "The number of items to return. Defaults to 20.", + "x-ms-summary": "limit", + "x-ms-url-encoding": "single" + }, + { + "name": "archived", + "in": "query", + "required": false, + "type": "boolean", + "default": false, + "enum": [ + false, + true + ], + "description": "If True, the page will not show up in your dashboard, although the page will still be live.", + "x-ms-summary": "archived", + "x-ms-url-encoding": "single" + }, + { + "name": "id", + "in": "query", + "required": false, + "type": "string", + "description": "The ID of the page to return.", + "x-ms-summary": "id", + "x-ms-url-encoding": "single" + }, + { + "name": "name", + "in": "query", + "required": false, + "type": "string", + "description": "The name of the page to return.", + "x-ms-summary": "name", + "x-ms-url-encoding": "single" + } + ] + }, + "post": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Create a new page (V2)", + "description": "Create a new page.", + "operationId": "PagesCreate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": false, + "schema": { + "type": "object", + "properties": { + "campaign": { + "title": "Campaign", + "type": "string", + "description": "The guid of the marketing campaign this page is associated with" + }, + "campaign_name": { + "title": "Campaign name", + "type": "string", + "description": "The name of the marketing campaign this page is associated with." + }, + "footer_html": { + "title": "Footer HTML", + "type": "string", + "description": "Custom HTML for embed codes, javascript, etc. that goes in the tag of the page." + }, + "head_html": { + "title": "Head HTML", + "type": "string", + "description": "The HTML for the head." + }, + "is_draft": { + "title": "Is draft", + "type": "string", + "description": "Whether page is draft." + }, + "meta_description": { + "title": "Meta description", + "type": "string", + "description": "The meta description for the page." + }, + "meta_keywords": { + "title": "Meta keywords", + "type": "string", + "description": "The meta keywords for the page." + }, + "name": { + "title": "Name", + "type": "string", + "description": "The name of the page." + }, + "password": { + "title": "Password", + "type": "string", + "description": "Set this to create a password protected page. Entering the password will be required to view the page." + }, + "publish_date": { + "title": "Publish date", + "type": "string", + "description": "The publish date for the page." + }, + "publish_immediately": { + "title": "Publish immediately", + "type": "string", + "description": "Set this to true if you want to be published immediately when the schedule publish endpoint is called, and to ignore the publish_date setting" + }, + "slug": { + "title": "Slug", + "type": "string", + "description": "The slug of the page." + }, + "subcategory": { + "title": "Subcategory", + "type": "string", + "description": "This is set to empty or to \"landing_page\" for landing pages, or to \"site_page\" for site pages." + }, + "widget_containers": { + "title": "Widget containers", + "type": "string", + "description": "A data structure containing the data for all the modules inside the containers for this post." + }, + "widgets": { + "title": "Widgets", + "type": "string", + "description": "A data structure containing the data for all the modules for this page." + } + } + } + } + ] + } + }, + "/content/api/v2/pages/{page_id}": { + "delete": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Delete a page (V2)", + "description": "Marks a page as deleted. Returns 204 No Content letting you know that the page was successfully deleted. The page can be restored later via a POST to the restore-deleted endpoint.", + "operationId": "PagesArchive", + "parameters": [ + { + "name": "page_id", + "in": "path", + "required": true, + "type": "string", + "description": "The page ID of the page.", + "x-ms-summary": "page_id", + "x-ms-url-encoding": "single" + } + ] + }, + "put": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Update a page (V2)", + "description": "Updates a page in the database. If not all top level fields are included in the body, we will only update the included fields.", + "operationId": "PagesUpdate", + "parameters": [ + { + "name": "page_id", + "in": "path", + "required": true, + "type": "string", + "description": "The page ID of the page.", + "x-ms-summary": "page_id", + "x-ms-url-encoding": "single" + }, + { + "name": "body", + "in": "body", + "required": false, + "schema": { + "type": "object", + "properties": { + "campaign": { + "title": "Campaign", + "type": "string", + "description": "The guid of the marketing campaign this page is associated with." + }, + "campaign_name": { + "title": "Campaign name", + "type": "string", + "description": "The name of the marketing campaign this page is associated wit." + }, + "footer_html": { + "title": "Footer HTML", + "type": "string", + "description": "Custom HTML for embed codes, javascript that should be placed before the tag of the page." + }, + "head_html": { + "title": "Head HTML", + "type": "string", + "description": "Custom HTML for embed codes, javascript, etc. that goes in the tag of the page." + }, + "is_draft": { + "title": "Is draft", + "type": "string", + "description": "Whether page is draft." + }, + "meta_description": { + "title": "Meta description", + "type": "string", + "description": "The meta description for the page." + }, + "meta_keywords": { + "title": "Meta keywords", + "type": "string", + "description": "The meta keywords for the page" + }, + "name": { + "title": "Name", + "type": "string", + "description": "The name of the page." + }, + "password": { + "title": "Password", + "type": "string", + "description": "Set this to create a password protected page. Entering the password will be required to view the page." + }, + "publish_date": { + "title": "Publish date", + "type": "string", + "description": "The publish date of the page." + }, + "publish_immediately": { + "title": "Publish immediately", + "type": "string", + "description": "Set this to true if you want to be published immediately when the schedule publish endpoint is called, and to ignore the publish_date setting." + }, + "slug": { + "title": "Slug", + "type": "string", + "description": "The slug of the page" + }, + "subcategory": { + "title": "Subcategory", + "type": "string", + "description": "This is set to empty or to \"landing_page\" for landing pages, or to \"site_page\" for site pages." + }, + "widget_containers": { + "title": "Widget containers", + "type": "string", + "description": "A data structure containing the data for all the modules inside the containers for this post." + }, + "widgets": { + "title": "Widgets", + "type": "string", + "description": "A data structure containing the data for all the modules for this page." + } + } + } + } + ] + } + }, + "/content/api/v2/pages/{page_id}/publish-action": { + "post": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Publish or unpublish a page (V2)", + "description": "Either publishes or cancels publishing based on the POSTed JSON.", + "operationId": "PagesPublish", + "parameters": [ + { + "name": "page_id", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the page", + "x-ms-summary": "page_id", + "x-ms-url-encoding": "single" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "description": "Either publishes or cancels publishing based on the selected action", + "title": "", + "enum": [ + "push-buffer-live", + "schedule-publish", + "cancel-publish" + ] + } + }, + "required": [ + "action" + ] + } + } + ] + } + }, + "/content/api/v2/templates": { + "get": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "List templates (V2)", + "description": "Get all templates.", + "operationId": "TemplatesList", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "type": "integer", + "default": 20, + "description": "The number of items to return. Defaults to 20.", + "x-ms-summary": "limit", + "x-ms-url-encoding": "single" + }, + { + "name": "id", + "in": "query", + "required": false, + "type": "string", + "description": "Tne ID of the template.", + "x-ms-summary": "id", + "x-ms-url-encoding": "single" + } + ] + }, + "post": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Create a new template (V2)", + "description": "Create a new coded template object in Design Manager.", + "operationId": "TemplatesCreate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": false, + "schema": { + "type": "object", + "properties": { + "category_id": { + "type": "integer", + "format": "int32", + "description": "The category id of the template", + "title": "", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ] + }, + "folder": { + "title": "Folder", + "type": "string", + "description": "folder" + }, + "is_available_for_new_content": { + "type": "boolean", + "description": "Used to determine if the template should be expected to pass page/content validation and be used with live content.", + "title": "", + "default": false, + "enum": [ + false, + true + ] + }, + "template_type": { + "type": "integer", + "format": "int32", + "description": "This parameter accepts a numeric value and sets the type of template that is created.", + "title": "", + "enum": [ + 2, + 4, + 6, + 11, + 12, + 13, + 14, + 19 + ] + }, + "path": { + "title": "Path", + "type": "string", + "description": "The Design Manager path to the directory that contains the file being created." + }, + "source": { + "title": "Source", + "type": "string", + "description": "The source code of the file." + } + } + } + } + ] + } + }, + "/content/api/v2/templates/{template_id}": { + "delete": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Delete a template (V2)", + "description": "Marks the selected Template as deleted. The Template can be restored later via a POST to the restore-deleted endpoint.", + "operationId": "TemplatesArchive", + "parameters": [ + { + "name": "template_id", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the template.", + "x-ms-summary": "template_id", + "x-ms-url-encoding": "single" + } + ] + }, + "put": { + "responses": { + "default": { + "description": "default", + "schema": {} + } + }, + "summary": "Update a template (V2)", + "description": "Updates a template. If not all the fields are included in the body, we will only update the included fields.", + "operationId": "TemplatesUpdate", + "parameters": [ + { + "name": "template_id", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the template.", + "x-ms-summary": "template_id", + "x-ms-url-encoding": "single" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "source": { + "title": "Source", + "type": "string", + "description": "The source code of the file." + } + }, + "required": [ + "source" + ] + }, + "description": "The body of the template", + "x-ms-summary": "body", + "x-ms-url-encoding": "single" + } + ] + } + } + }, + "definitions": {}, + "parameters": {}, + "responses": {}, + "tags": [], + "x-ms-connector-metadata": [ + { + "propertyName": "Website", + "propertyValue": "https://www.hubspot.com/" + }, + { + "propertyName": "Privacy policy", + "propertyValue": "https://legal.hubspot.com/privacy-policy" + }, + { + "propertyName": "Categories", + "propertyValue": "Marketing" + } + ] +} diff --git a/independent-publisher-connectors/HubSpot CMS/apiProperties.json b/independent-publisher-connectors/HubSpot CMS/apiProperties.json new file mode 100644 index 000000000..1b702a459 --- /dev/null +++ b/independent-publisher-connectors/HubSpot CMS/apiProperties.json @@ -0,0 +1,36 @@ +{ + "properties": { + "connectionParameters": { + "token": { + "type": "oauthSetting", + "oAuthSettings": { + "identityProvider": "oauth2", + "clientId": "[YOUR_VALUE]", + "scopes": [ + "forms files hubdb transactional-email settings.users.write conversations.visitor_identification.tokens.create integration-sync tickets e-commerce files.ui_hidden.read crm.objects.marketing_events.read accounting crm.objects.marketing_events.write crm.schemas.custom.read crm.objects.custom.read crm.objects.feedback_submissions.read sales-email-read crm.objects.custom.write forms-uploaded-files settings.users.read crm.import contacts content reports social automation settings.billing.write actions timeline business-intelligence" + ], + "redirectMode": "Global", + "redirectUrl": "https://global.consent.azure-apim.net/redirect", + "properties": { + "IsFirstParty": "False" + }, + "customParameters": { + "authorizationUrl": { + "value": "https://app.hubspot.com/oauth/authorize" + }, + "tokenUrl": { + "value": "https://api.hubapi.com/oauth/v1/token" + }, + "refreshUrl": { + "value": "https://api.hubapi.com/oauth/v1/token" + } + } + } + } + }, + "iconBrandColor": "#da3b01", + "capabilities": [], + "publisher": "Hitachi Solutions", + "stackOwner": "HubSpot" + } +}