Simple (I think) requirement for CRM Extensions API
Hi there. I'm new to this forum so bear with my ignorance of the Hubspot API.....
I have what I think is a simple requirement; I would like to present an extra option to the user whenever he/she clicks the Actions drop-down for any contact.
The option will be called "Add A Quote", and the action of the click will be to open a pop-window which will show the Add Quote option from another CRM system. No POSTed variables, nothing fancy, just a URL that opens in a pop-up window.
What's the most effective way to do this? I have read the documentation about the CRM Extensions API, so I think that's the way forward, but that's as far as I've got at the moment.
I'm fairly experienced in API coding to push and pull data between systems but this is a new area for me.
Simple (I think) requirement for CRM Extensions API
Thanks for this Connor.
Forgive my ignorance, but where do you code this action? I think I can figure out the JSON I need to code, but I don't see how I code the POST request.
I have a developer account, and I have created a public app called Hubspot XTRF API(https://app.hubspot.com/developer/4638459/application/176110), but I don't see anywhere to actually write the code and I don't know how to integrate that into the live application once it has been tested.
Sorry but I think I'm going to need some hand-holding with this.
Simple (I think) requirement for CRM Extensions API
Hey @mike.mackechnie, you'd code this wherever you application (i.e. the actual code that makes your app run is deployed). No code is actually written from within the developer account. For example, I pushed my code here up to heroku, so that's where my code lives. An example way to POST data would be to have this structure returned and ready to use when you load up a contact company or deal:
You'd handle your POST and GET routes from within your application, wherever it may be hosted, and format the JSON in the above way so that any time your specified objects from your dev account are loaded, the request URL defined in the settings is requested, and those actions defined within your application are then available to use. Here are a few examples of how my dev account settings looks:
Simple (I think) requirement for CRM Extensions API
I got dragged off to another project, but on returning to this I managed to get the I-Frame working fine - only snag is I appear to be forbidden to load my XTRF window into the frame.
Taking a look at your dataFetch URI in your app settings where I linked above, when I visit that URL, it looks like that page is just a webpage where you log in. When I click on the action on that contact record, I'm getting a 405 - Method Not Allowed.
If I'm misunderstanding, you'd want somebody to be able to log in from that screen and create a Quote straight from HubSpot, correct?
If so, you should probably be using an IFRAME type instead of an ACTION HOOK. I'd do something like this:
This all said, the base URI that your app is requesting isn't present in your settings, and that URI (https://workflow.k-international.com/xtrf/faces/projectAssistant/quotes/create.seam#/newQuote) is the action you have attached to your extension. However, even when I add in your base URI to your app in the settings, the iFrame still isn't loading because of the headers set on workflow.k-international.com:
Simple (I think) requirement for CRM Extensions API
Hi @mike_mackechnie , sorry if I wasn't clear in my last response. That console error is being thrown by the domain that sets those headers (https://testxtrf.k-international.com/), not your app. If you were to implement this iFrame popup for your CRM extension, you'd have to edit the headers to allow cross origin framing on testxtrf.k-international.com.
Simple (I think) requirement for CRM Extensions API
We want to "surface" a link to our Customer Portal application using the CRM Extensions API.
Ideally this link should be in the Actions drop down list below the contact name, although it would also be acceptable to locate it on the sidebar, as long as it is the next card after the contact name.
The card or action should simply be a link with the text, ”Add a Quote”, and clicking on that link will trigger a process.
The process will be:
Check if the customer (Company) exists on our Customer Portal. If not, add the company by calling an API (I would expect to see a screen throbber whilst the add company is processing):
Check if the contact (person) exists on our Customer Portal. If not, add the contact by calling an API (I would expect to see a screen throbber whilst the add contact is processing):
POST /customers/persons/ HTTP/1.1
Accept: application/vnd.xtrf-v1+json{
"name": "Nowy",
"customerId": 111,
"contact": {
"emails": {
"primary": "nowy@person.org"
}
}
}
Then, with the customer and contact defined, open a pop-up window into the Customer Portal and display the Add Quote screen:
Our Sales staff can then follow their internal procedures to add the quote to our Customer Portal.
Once the quote has been completed, the pop-up window can be closed and focus will return to the Hubspot contact screen. A background process will be triggered on completion of the quote which will add a corresponding deal to Hubspot.