APIs & Integrations

DCrinnion1
Contributor

Custom Object Association Error

SOLVE

Hi All,

 

First time trying Custom Code actions in workflows. I copied and pasted from GitHub then re-worked with ChatGPT a custom code action that will check if the Partner Referrer Code on the contact level is equal to the Partner Code (on the Partner Custom Object) then associate the two. 

 

However it keeps coming up with a Hubspot 2.0 Auth error can someone please show me what I am doing wrong.

 

Here is the Error: HTTP-Code: 401 Message: An error occurred. Body: {"status":"error","message":"Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview","correlationId":"48552397-bf32-4f13-88ea-7e5fee462991","category":"INVALID_AUTHENTICATION"} Headers: {"access-control-allow-credentials":"false","cf-cache-status":"DYNAMIC","cf-ray":"8ea39a19fcd691f9-FRA","connection":"keep-alive","content-length":"299","content-type":"application/json;charset=utf-8","date":"Fri, 29 Nov 2024 15:23:58 GMT","nel":"{\"success_fraction\":0.01,\"report_to\":\"cf-nel\",\"max_age\":604800}","report-to":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=1TgjHIgQ6ZbjriKOm9BzMKcayy2yKO3g7vOkA7Hma1dN2ZBZ9EQxSHchPw3Fg%2Bx0NawvbjUQI8hFR4bJ1cKLXmhccnnF1YQSWE23faEg69hsKV7vicAUFFfTgboBQ0Yq\"}],\"group\":\"cf-nel\",\"max_age\":604800}","server":"cloudflare","strict-transport-security":"max-age=31536000; includeSubDomains; preload","vary":"origin, Accept-Encoding","x-content-type-options":"nosniff","x-hubspot-auth-failure":"401 Unauthorized","x-hubspot-correlation-id":"48552397-bf32-4f13-88ea-7e5fee462991"}
Screenshot 2024-11-29 at 15.23.23.pngScreenshot 2024-11-29 at 15.23.33.png

0 Upvotes
2 Accepted solutions
SteveHTM
Solution
Guide | Partner
Guide | Partner

Custom Object Association Error

SOLVE

@DCrinnion1 - the error message you report is similar to the that received when you provide an incorrect provate app token in the heqder of the API call. I don't see this https header setup in the code fragment provided, so maybe that's the first thing to check?

 

Good luck!

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature

View solution in original post

0 Upvotes
SteveHTM
Solution
Guide | Partner
Guide | Partner

Custom Object Association Error

SOLVE

All API calls require authentication via OAuth or a Private API key with the right scopes for the object you want to manipulate. I'm sure ChatGPT would agree with that!

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature

View solution in original post

0 Upvotes
3 Replies 3
DCrinnion1
Contributor

Custom Object Association Error

SOLVE

Hey Steve!

 

Apologies I am new to coding. Do I need to provide a private app token if I am trying to get an API call inside of Hubspot and not externally?

 

0 Upvotes
SteveHTM
Solution
Guide | Partner
Guide | Partner

Custom Object Association Error

SOLVE

All API calls require authentication via OAuth or a Private API key with the right scopes for the object you want to manipulate. I'm sure ChatGPT would agree with that!

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes
SteveHTM
Solution
Guide | Partner
Guide | Partner

Custom Object Association Error

SOLVE

@DCrinnion1 - the error message you report is similar to the that received when you provide an incorrect provate app token in the heqder of the API call. I don't see this https header setup in the code fragment provided, so maybe that's the first thing to check?

 

Good luck!

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes