APIs & Integrations

jandrews
Participante

Update Contact's custom property

resolver

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.Screen Shot 2020-07-24 at 3.29.08 PM.png

0 Me gusta
1 Soluciones aceptada
WendyGoh
Solución
HubSpot Employee
HubSpot Employee

Update Contact's custom property

resolver

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?

Ver la solución en mensaje original publicado

0 Me gusta
5 Respuestas 5
WendyGoh
HubSpot Employee
HubSpot Employee

Update Contact's custom property

resolver

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?

0 Me gusta
jandrews
Participante

Update Contact's custom property

resolver

Hi Wendy,

 

Below are my responses:

  1. Yes, I am using the PATCH /crm/v3/objects/contacts/{contactId} endpoint
  2. ({
          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
  3. I'm using hapikey for authorization
  4.  portal ID is 7296433
0 Me gusta
WendyGoh
Solución
HubSpot Employee
HubSpot Employee

Update Contact's custom property

resolver

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?

0 Me gusta
jandrews
Participante

Update Contact's custom property

resolver

Got it working! thanks for your help

jandrews
Participante

Update Contact's custom property

resolver

@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
0 Me gusta