APIs & Integrations

Not applicable

Is there an easy way to separate each property in the properties array

I am having fun trying to integrate an old Student Record system written in VS2008 (VB.NET) with HS.
I’ve got it updating HS contacts OK. I just need to workout the pulling back of data.

Is there an easy way to separate each property in the contacts properties array ?

Thanks.

0 Upvotes
9 Replies 9
3PETE
HubSpot Employee
HubSpot Employee

Is there an easy way to separate each property in the properties array

@SueDonLtd The response format cannot be changed. You can however choose which properties you pull back if you are using the get all contacts endpoint.

0 Upvotes
Not applicable

Is there an easy way to separate each property in the properties array

Thanks for getting back.
I have noted the requesting of individual or group of properties and I have routine to grab “theVID” and the “properties object”. It is the decoding of a properties object I am having fun with. I need to pull individual values for a given property.
e.g. extract just the phone or firstname from a set of properties and their attributes.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there an easy way to separate each property in the properties array

@SueDonLtd Are you stuck pulling the firstname and phone?

0 Upvotes
Not applicable

Is there an easy way to separate each property in the properties array

In effect yes.
I can request the data and obtain the “properties object” contain the properties requested. It is understanding this object and being able to extract individual values e.g. email=MMM@YYY.com, firstname=ZZZZZ.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there an easy way to separate each property in the properties array

@SueDonLtd That all depends on which language you are using to parse the object. You just need to grab the value of the value property for each one. So firstname.value or email.value.

What language are you using?

0 Upvotes
Not applicable

Is there an easy way to separate each property in the properties array

As given in my first post VB.Net (VS2008)

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there an easy way to separate each property in the properties array

Does VB.net read JSON? If not is there a library you can use to transform it into a VB.net object?

0 Upvotes
Not applicable

Is there an easy way to separate each property in the properties array

From .Net 3.5 there has been JSON libraries in Visual Studio.
You can also add the Newtownsoft libraries.

However, when I have tried using these with the “properties” string I get from HS it does not like the format.
An example is:
{
“firstname”: {
“value”: “DonTest01_Upd”
},
“lastmodifieddate”: {
“value”: “1487086970673”
},
“email”: {
“value”: "test1@yahoo.co.uk"
},
“lastname”: {
“value”: “Contact01”
}
}

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Is there an easy way to separate each property in the properties array

@SueDonLtd I’m not well versed enough in VB.net to offer any advice on the best way to parse JSON. The problem seems to be with your syntax and not an issue with hitting a HubSpot API. Perhaps someone else here in the forum can lend a hand on which library would be best for you to use. We need to find a library that can parse through an array of json objects into a VB.net object.

0 Upvotes