Hello,
I’m using the API documentation to update a single property of a contact. I keep getting the below error message:
Error: One or more parameters provided did not match the function signature
My function signature mirrors tat of the documentation. and I cannot figure out what I am doing wrong. The custom property I am trying to update is a string value. Please help.
Hey @jandrews,
In order for me to further troubleshoot this, could you share with me the following:
1. Are you using the PATCH /crm/v3/objects/contacts/{contactId} endpoint?
2. If so, what’s the exact POST body that you’re using?
3. What’s the authentication type that you’re using - API key/OAuth?
4. What’s the portal ID in question?
Hi Wendy,
Below are my responses:
- Yes, I am using the PATCH /crm/v3/objects/contacts/{contactId} endpoint
-
({
method: ‘PATCH’,
url: ‘https://api.hubapi.com/crm/v3/objects/contacts’ + hubspotID,
headers: {
‘content-type’: ‘application/json’
},
queryParams: {
‘hapikey’: TEST_HUBSPOT_API_KEY
},
body: JSON.stringify({
‘properties’: {
‘stripe’: stripeID
}
}),
json: true
});Varaibles in the above code: hubspotID = vid and stripeID = customer id
1. I'm using hapikey for authorization
1. portal ID is 7296433
Hey @jandrews,
On my end, when I test out the following:
PATCH crm/v3/objects/contacts/11801
POST body
{
"properties": {
"stripe": 123
}
}
I was able to a 200 response.
In this case, it seems that the url that you’re using may be missing a ‘/’. Right now you’re using:
url: 'https://api.hubapi.com/crm/v3/objects/contacts' + hubspotID,
however after contacts there should be a ‘/’. As such, could you try the following:
url: 'https://api.hubapi.com/crm/v3/objects/contacts/' + hubspotID,
and see if it works?
@WendyGoh , unfortunately, the “/” did not make a difference. I still get the response
Error: One or more parameters provided did not match the function signature
Got it working! thanks for your help