APIs & Integrations

MUfland
Mitglied

API Post to Create Contact is not adding any properties

lösung

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 Akzeptierte Lösung
JBeatty
Lösung
Ratgeber/-in | Diamond Partner
Ratgeber/-in | Diamond Partner

API Post to Create Contact is not adding any properties

lösung

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

Lösung in ursprünglichem Beitrag anzeigen

4 Antworten
JBeatty
Lösung
Ratgeber/-in | Diamond Partner
Ratgeber/-in | Diamond Partner

API Post to Create Contact is not adding any properties

lösung

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
Mitglied

API Post to Create Contact is not adding any properties

lösung

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/-in
Community-Manager/-in

API Post to Create Contact is not adding any properties

lösung

Thank you Josh for your advice!

@MUfland Please check out ↑

0 Upvotes
natsumimori
Community-Manager/-in
Community-Manager/-in

API Post to Create Contact is not adding any properties

lösung

Thank you for your post @MUfland .

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

0 Upvotes