CRM Extension Has no effect at all (

crm_extensions

#1

Good day.
I’m trying to create a test extension for Contacts.
My flow:

  1. Create App
  2. Set scope to “Contacts”
  3. Create CRM extension Object type
    Title: "Sample"
    Data fetch URI: My json reponse uri
    Associated HubSpot objects: Contacts (email)
  4. I add property (sampleData:string)
  5. I Authorize my App with portal (https://app.hubspot.com/oauth/authorize?client_id=xxx&client_secret=xxx&redirect_uri=https%3A%2F%2Fapp.hubspot.com%2F&scope=contacts")
  6. In list of portals select required portal (No error messages everything seems fine)
  7. On my portal I navigate to contact card
    And I don’t see my extension. :frowning:

Sample json from fetch uri:

{"results":{"0":{"objectId":123,"email":"sample@mail.com","title":"SampleData create value API call test","sampleData":"Some data"}},"totalCount":1}

Notes:
I’m under free type subscription. (If it can any way be the reason, but for dev purposes it would not have sense :slight_smile: )
No API requests are indicated in Monitoring section

Sample video

Maybe I’m missing something or doing something wrong?


#2

Hi @Pavel_Budo,

Based solely on the video you included, there isn’t any data being returned from your data fetch URI since it was just set to http://sample.uri. When an object (in this case, a contact) is loaded, the CRM makes a request to the data fetch URI in order to get sales objects for a given record. Since the data fetch URI wasn’t real, no data was returned. Are you using an actual data fetch URI in your tests? I’ve included the CRM Extensions Overview below, for reference:


#3

Yes the uri on video is dummy and there for has no proper response.
My clear url that I set in extension is returning content with application/json header. And return data is described in my text flow description :slight_smile:


#4

Also I think I see possible mistake of my, but have not tested it yet. So maybe in this case you can tell if it is the right direction (anyway if no other suggestions would test it :slight_smile: ). I think I misunderstood a bit the oauth targets, and I must call authorization with not the hubspot redirect uri, but with my fetch uri target?
I mean instead of:
../oauth/authorize?client_id=xxx&client_secret=xxx&redirect_uri=https%3A%2F%2Fapp.hubspot.com%2F&scope=contacts
it must be
../oauth/authorize?client_id=xxx&client_secret=xxx&redirect_uri=https://sample.uri/fetch-data&scope=contacts

Will try it out tomorrow, as need few updates to set my server to https :frowning:


#5

Tested to authorize with my own https link redirct, and it had no effect :(. So still as I see the main reason for authorization link is mostly for API usage from my side.

So the main question is still open :frowning:


#6

Hi @Pavel_Budo,

How exactly is the data fetch response being formatted? Based on the sample JSON you provided, it looks like it might not match the expected response format listed in the overview doc. Here’s an example data fetch response:

{
  "results": [
    {
      "objectId": 245,
      "title": "API-22: APIs working too fast",
      "link": "http://example.com/1",
      "created": "2016-09-15",
      "priority": "HIGH",
      "project": "API",
      "reported_by": "msmith@hubspot.com",
      "description": "Customer reported that the APIs are just running too fast. This is causing a problem in that they're so happy.",
      "reporter_type": "Account Manager",
      "status": "In Progress",
      "ticket_type": "Bug",
      "updated": "2016-09-28",
      "actions": [
        {
          "type": "IFRAME",
          "width": 890,
          "height": 748,
          "uri": "https://example.com/edit-iframe-contents",
          "label": "Edit",
          "associatedObjectProperties": []
        },
        {
          "type": "IFRAME",
          "width": 890,
          "height": 748,
          "uri": "https://example.com/reassign-iframe-contents",
          "label": "Reassign",
          "associatedObjectProperties": []
        },
        {
          "type": "ACTION_HOOK",
          "httpMethod": "PUT",
          "associatedObjectProperties": [],
          "uri": "https://example.com/tickets/245/resolve",
          "label": "Resolve"
        },
        {
          "type": "CONFIRMATION_ACTION_HOOK",
          "confirmationMessage": "Are you sure you want to delete this ticket?",
          "confirmButtonText": "Yes",
          "cancelButtonText": "No",
          "httpMethod": "DELETE",
          "associatedObjectProperties": [
            "protected_account"
          ],
          "uri": "https://example.com/tickets/245",
          "label": "Delete"
        }
      ]
    }
  ],
  "settingsAction": {
    "type": "IFRAME",
    "width": 890,
    "height": 748,
    "uri": "https://example.com/settings-iframe-contents",
    "label": "Settings"
  },
  "primaryAction": {
    "type": "IFRAME",
    "width": 890,
    "height": 748,
    "uri": "https://example.com/create-iframe-contents",
    "label": "Create Ticket"
  }
}

#7

Don’t think that it is the case, but will true to create with full data response from documentation.
Do explain why I don’t think so:

  1. Data in response of documentation is fully for sample type object with actions (as it shows in documentation screenshots)
  2. I I got it from documentation main fields are:
    "objectId", - But not clear if it is just id to store my data fetch or is id of Object type
    "title" - Title is just header for my custom block

#8

And one more thing is that there is no request to my server side server at all in log :frowning: So it seems it doen’t even does the request to fetch my side data


#9

Hi @Pavel_Budo,

Can you send me the app id for your CRM Extension app, and the Hub ID for a test portal where you’ve installed the app?