You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
We use Nest.js framework as backend and we also integrated Hubspot service by using this open source pretty library. First of all thank you.
The Problem is that we have to call two times the Nest.js API, which we created to remove an contact from list. Under this API controller/action I have the code which uses the service similar the following class(it is written on Typescript and there are two placeholders {MY_API_KEY_HERE} and {MY_CONTACT_LIST_ID_HERE}).
// file hubspot.service.tsimportHubspotfrom'hubspot'exportclassHubspotService{protected_client=nullpublicapiKey='{MY_API_KEY_HERE}'publiclistId='{MY_CONTACT_LIST_ID_HERE}'publicgetclient(): Hubspot{if(!this._client){this._client=newHubspot({apiKey: this.apiKey})}returnthis._client}publicasyncremoveContactFromList(conactId: number){try{letresponse=awaitthis.client.lists.removeContacts(this.listId,{vids: [conactId]})console.log('Successful Hubspot remove contact from list response: ',response)}catch(e){console.log(`Hubspot contact remove contact from list error: ${e.message}`)throwe}}publicasyncaddContactToList(conactId: number){try{letresponse=awaitthis.client.lists.addContacts(this.listId,{vids: [conactId]})console.log('Successful Hubspot add contact to list response: ',response)}catch(e){console.log(`Hubspot contact add to list error: ${e.message}`)throwe}}}
here is what I'm getting as response in console after the text 'Successful Hubspot remove contact from list response: ' when I calling the removeContactFromList(conactId: number) above function by using conactId=1951:
The fact is that not every time(as I noticed about every time) this function single call do not remove the contact from the list and just after second API call the contact gets removed from list.
I tried direct Hubspot API calls by using curl and the contact getting removed from contact list after single call:
The interesting moment is that I have also addContactToList(conactId: number) function in my Typescript class and it works normally just after first call.
Please if any one can have any idea what the issue is, I will be very happy, so that there will not be need to have to double call the contact remove from list backend API two times (this is my workaround for now to fix the issue manually). Let me know if you need more information on this.
Thank you
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi everyone,
We use Nest.js framework as backend and we also integrated Hubspot service by using this open source pretty library. First of all thank you.
The Problem is that we have to call two times the Nest.js API, which we created to remove an contact from list. Under this API controller/action I have the code which uses the service similar the following class(it is written on Typescript and there are two placeholders {MY_API_KEY_HERE} and {MY_CONTACT_LIST_ID_HERE}).
here is what I'm getting as response in console after the text 'Successful Hubspot remove contact from list response: ' when I calling the removeContactFromList(conactId: number) above function by using conactId=1951:
The fact is that not every time(as I noticed about every time) this function single call do not remove the contact from the list and just after second API call the contact gets removed from list.
I tried direct Hubspot API calls by using curl and the contact getting removed from contact list after single call:
The interesting moment is that I have also addContactToList(conactId: number) function in my Typescript class and it works normally just after first call.
Please if any one can have any idea what the issue is, I will be very happy, so that there will not be need to have to double call the contact remove from list backend API two times (this is my workaround for now to fix the issue manually). Let me know if you need more information on this.
Thank you
The text was updated successfully, but these errors were encountered: