APIs & Integrations

MUfland
Member

API Post to Create Contact is not adding any properties

SOLVE

Hi,

 

I am playing with the API in my Dev Account and trying to add a contact using C# and Postman via the contacts api. The contact seems to be added in Hubspot but none of the data is transferred.

 

The request is going here https://api.hubapi.com/crm/v3/objects/contacts?hapikey=xxxxxx-xxxx-xxxx-xxxx-xxxxxx96caf

 

The test data is this 

 

{"company":"MU Ltd","email":"mark@mulitd.com","firstname":"Mark","lastname":"Ufland","phone":"077676676767","website":"mulitd.com"}
 
The response is this:
 
{
    "id""351",
    "properties": {
        "createdate""2021-06-24T09:18:29.818Z",
        "hs_is_unworked""true",
        "hs_marketable_status""false",
        "hs_marketable_until_renewal""false",
        "hs_object_id""351",
        "lastmodifieddate""2021-06-24T09:18:29.818Z"
    },
    "createdAt""2021-06-24T09:18:29.818Z",
    "updatedAt""2021-06-24T09:18:29.818Z",
    "archived"false
}
 
Do you have any ideas?
 
Thanks,
 
Mark
 
0 Upvotes
1 Accepted solution
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

API Post to Create Contact is not adding any properties

SOLVE

Hi @MUfland,

I believe the issue here is the data of your request. From the API docs the example data they give is:

 

{
  "properties": {
    "company": "Biglytics",
    "email": "bcooper@biglytics.net",
    "firstname": "Bryan",
    "lastname": "Cooper",
    "phone": "(877) 929-0687",
    "website": "biglytics.net"
  }
}

 

So I would try to reformat your request data like this:

 

{"properties":{"company":"MU Ltd","email":"mark@mulitd.com","firstname":"Mark","lastname":"Ufland","phone":"077676676767","website":"mulitd.com"}}

 

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

View solution in original post

4 Replies 4
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

API Post to Create Contact is not adding any properties

SOLVE

Hi @MUfland,

I believe the issue here is the data of your request. From the API docs the example data they give is:

 

{
  "properties": {
    "company": "Biglytics",
    "email": "bcooper@biglytics.net",
    "firstname": "Bryan",
    "lastname": "Cooper",
    "phone": "(877) 929-0687",
    "website": "biglytics.net"
  }
}

 

So I would try to reformat your request data like this:

 

{"properties":{"company":"MU Ltd","email":"mark@mulitd.com","firstname":"Mark","lastname":"Ufland","phone":"077676676767","website":"mulitd.com"}}

 

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

MUfland
Member

API Post to Create Contact is not adding any properties

SOLVE

Hi Josh,

 

Thanks for that, it did the trick. I must be getting old as I didn't spot that when reading the docs. Sometimes you need another pair of eyes.

 

Regards,

Mark

0 Upvotes
natsumimori
Community Manager
Community Manager

API Post to Create Contact is not adding any properties

SOLVE

Thank you Josh for your advice!

@MUfland Please check out ↑

0 Upvotes
natsumimori
Community Manager
Community Manager

API Post to Create Contact is not adding any properties

SOLVE

Thank you for your post @MUfland .

@LPM and @JBeatty , would you mind sharing your advice for @MUfland ?

0 Upvotes