APIs & Integrations

tbailey
Member

API Post into an existing source in Hubspot

SOLVE

There appears to be an existing source called Affiliate (see below).
{
"hidden": true,
"label": "Affiliate",
"value": "Affiliate",
"readOnly": null,
"description": null,
"displayOrder": -1,
"doubleData": null

How do we post via API into this source? Two attempts have both failed using "lead source" and the c_source fields. See posting strings below. No record of either contact is showing up.

firstname=Georgeanna&lastname=Henseler&email=etiam%40exactamedia.com&phone=5618258185&address=3+Homestead+Lane+Gardens&city=Slocomb&state=NH&zip=15239&leadsource=Affiliate

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

Hi @tbailey,

All contacts created through the Contacts API are treated as having come from an offline integration, so they all have the Original Source value "Offline Sources."

While it's not possible to programmatically set or change an Original Source, Original source drill-down 1, or Original source drill-down 2 value, you can push "Affiliate" into a different default or custom contact property, as you did successfully (but in the wrong account) with the leadsource property. There's no property with the internal name leadsource in your portal at this time, but you can certainly create one.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
27 Replies 27
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

@tbailey,

Is your developer copied on these messages? Their code was able to create contacts in the Hartford Gold Group before, so all you need is to create a custom property with the internal name leadsource (I hyperlinked the instructions in the last post), an option for "Affiliate," and for the API key to be switched to the one on this page. Your developer should be able to take it from here.

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Thanks Isaac! I will forward to him.

Thanks,

Tammy

IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

Hi @tbailey,

All contacts created through the Contacts API are treated as having come from an offline integration, so they all have the Original Source value "Offline Sources."

While it's not possible to programmatically set or change an Original Source, Original source drill-down 1, or Original source drill-down 2 value, you can push "Affiliate" into a different default or custom contact property, as you did successfully (but in the wrong account) with the leadsource property. There's no property with the internal name leadsource in your portal at this time, but you can certainly create one.

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Can you send me the instructions on how to do that?

Thanks!

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

I just tested this Contacts API endpoint with portal 4517614's API key and successfully created this contact. No contact was created in portal 2611654, proving the accounts have different API keys.

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Hi Isaac,

We can see your test leads and successfully submitted one on our side as well. The issue we see now is the lead says it was created from “Offline Sources”. How do we identify these leads with the source “Affiliate”.

Thanks,

Tammy

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

@tbailey,

Please don't post API keys here. I didn't even realize you did it before. This is a public forum and API keys allow complete access to whatever portal they belong to.

No, it is not possible to have the same API key as the Hartford Gold Group. To get the integration working, you'll have to use the API key which is displayed on this page.

Isaac Takushi

Associate Certification Manager
0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

I do see you as a user in portal 4517614, but then how did you get the API key for portal 2611654? The contact "Georgeanna Henseler" was successfully created via the Contacts API in that portal.

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Our client sent us the API key for Mt. Sierra. Is that incorrect? How do we get the correct version?

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

You can get the API key for portal 4517614 (Mt Sierra College) on this page (Settings > Integrations > Browse all integrations > Your integrations > API key > Show key).

The API key you were sent and used for the Contacts API belongs to portal 2611654 (Hartford Gold Group).

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Hi Isaac,

We are posting from a proprietary third party system not listed in your integrations. Does that matter? Do we need a custom API key as a result?

Thanks,
Tammy

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

Hey Tammy,

Yep, because you're using a custom, non-listed integration, you must use the API key I linked to in order to authenticate your requests. You were using the API key of a different portal entirely.

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

I just copied that one and it matches what we had before.

[Removed by moderator]

0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Is it possible to have the same API key as Hartford Gold Group?

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

@tbailey,

Are you a user in portal 2611654 (Hartford Gold Group)? I don't see your name in here. I got the portal ID from the code you shared earlier:

{"vid":61143951,"canonical-vid":61143951,"merged-vids":[],"portal-id":2611654

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Maybe that is the issue. I am a user for Mt. Sierra College.

0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE
  1. Is that the portal we should be using?
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE
  1. It got cut off in the previous response.
0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

API Post into an existing source in Hubspot

SOLVE

Hi @tbailey,

I am still unsure of what needs to be "fixed." As we have covered, the Contacts API call successfully created this contact in HubSpot with the "Affliliate" Lead source value.

The Contacts API is not an automatic two-way sync, so I cannot speak to why a specific record does not exist in your database. You can pull contacts from HubSpot to populate an external database with this endpoint, but that is separate from the method which created the contact above.

Isaac Takushi

Associate Certification Manager
0 Upvotes
tbailey
Member

API Post into an existing source in Hubspot

SOLVE

Issac,

The Contacts API did not successfully create the new contact. I can not see it in the Mt. Sierra log-in with the other contacts. Are you showing a record of that lead? We don't need a two way sync. I just need to get a lead posting successfully via the Contacts API and be able to view it in Hubspot.

0 Upvotes