I am using Hubspot integration for the first time. I want to get the vid of a newly created contact in the interface and I want to get his id in my code so I can use it. Still confused how to do it. i believe it could be done using Webhooks, but still don't know how.
Based off the fact that you want the Phone Number when the contact is created, I'd suggest working with a Webhook trigger via a Workflow. When this is done, we POST all the API data associated with this contact to your Webhook URL.
From there, you can build some code to extract the Phone Number and run a validation test on it.
Using the API though will lengthen the process as you'll have to use the Contact_ID to then fetch the Contact details via the Get a contact by ID endpoint, after they're created. This is essentially creating 2 calls needed to fetch the number before you can then run validation.
For the Get recently created contacts this will fetch a paginated list of contacts, with a maximum of 100 contacts per page, as specified by the count parameter. An example of this request can be seen below:
For Webhooks, you can use either the Workflows tool to trigger a webhook URL each time a contact is created, else, you can create an App which can then use webhooks to subscribe to specific events such as the contact creation event:
contact.creation - To get notified if any contact is created in a customer's account.
For using the workflows, see this article for assistance with the configuration. For the use of webhooks via an App, check out the link to the documentation here.
Thank you very much sir. the solution you provided was helpful and I could add something to what I have done. But, I am new this integration field and what I want to do is getting the phone numeber of the customer when it is created or updated in the UI so I can make the API call to my application to verify if it is valid or not. And I still do not know how to get the information from the UI and implement it in the code I want to use.
Based off the fact that you want the Phone Number when the contact is created, I'd suggest working with a Webhook trigger via a Workflow. When this is done, we POST all the API data associated with this contact to your Webhook URL.
From there, you can build some code to extract the Phone Number and run a validation test on it.
Using the API though will lengthen the process as you'll have to use the Contact_ID to then fetch the Contact details via the Get a contact by ID endpoint, after they're created. This is essentially creating 2 calls needed to fetch the number before you can then run validation.