添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi @Yasar 👋

Association types are directional , meaning they have a "from" object-type and a "to" object-type. You've attempted to create an association from a Company (first object type in your request URL) to an Employee [Custom Object] (second object type in your request URL). The error message you received suggests that your USER_DEFINED association type 162 does not match your attempted create association request.

I hope this proves useful. Please let me know if you have any follow-up questions.

HI @ zach_threadint ,


END Point URL :
----------------

/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create


https://api.hubapi.com/crm/v4/associations/Companies/2-18323995/batch/create

-- header 'content-type: application/json'


Request Body :
-------------

{
"inputs": [
{
"types": [
{
"associationCategory": "USER_DEFINED",
"associationTypeId": 155
}
],
"from": {
"id": "17168177704"
},
"to": {
"id": "18323995"
}
}
]
}


Response Body :
---------------

{
"status": "COMPLETE",
"results": [],
"numErrors": 1,
"errors": [
{
"status": "error",
"category": "VALIDATION_ERROR",
"message": "2-18323995=18323995 is not valid"
}
],
"startedAt": "2024-02-15T05:02:57.517Z",
"completedAt": "2024-02-15T05:02:57.548Z"
}

Hi @Yasar 👋

Would you please share additional information about your request (text format would be helpful):

  • Endpoint URL and method
  • Headers
  • Request Body JSON
  • Response Body JSON
  • Hi @zach_threadint


    END Point URL :
    --------------------

    /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create


    https://api.hubapi.com/crm/v4/associations/Companies/2-18323995/batch/create

    -- header 'content-type: application/json'


    Request Body :
    ------------------

    {
    "inputs": [
    {
    "types": [
    {
    "associationCategory": "USER_DEFINED",
    "associationTypeId": 155
    }
    ],
    "from": {
    "id": "17168177704"
    },
    "to": {
    "id": "18323995"
    }
    }
    ]
    }


    Response Body :
    ------------------

    {
    "status": "COMPLETE",
    "results": [],
    "numErrors": 1,
    "errors": [
    {
    "status": "error",
    "category": "VALIDATION_ERROR",
    "message": "2-18323995=18323995 is not valid"
    }
    ],
    "startedAt": "2024-02-15T05:02:57.517Z",
    "completedAt": "2024-02-15T05:02:57.548Z"
    }

    Thanks for coming back with more information regarding your request.

    This error message suggests that for custom object type "2-18323995", there's no record with ID " 18323995" (or maybe this record has been deleted/archived).

    I hope this proves useful. Please let me know if you have any follow-up questions.

    Hi @ zach_threadint ,

    We have tried with a different custom object also but this time also we are getting error message in the response.

    Request:

    ' https://api.hubapi.com/crm/v4/associations/company/2-18323835/batch/create'

    {
    "inputs": [
    {
    "types": [
    {
    "associationCategory": "USER_DEFINED",
    "associationTypeId": 162
    }
    ],
    "from": {
    "id": "16726619290"
    },
    "to": {
    "id": "18323835"
    }
    }
    ]
    }

    Response:

    {
    "status": "error",
    "message": "One or more association types in request don't match specified object types & direction: company -> employees",
    "correlationId": "d930d4e9-502a-454c-bf98-033efb0d0ea8",
    "context": {
    "USER_DEFINED": [
    "162"
    ]
    },
    "category": "VALIDATION_ERROR"
    }

    Hi @Yasar 👋

    Association types are directional , meaning they have a "from" object-type and a "to" object-type. You've attempted to create an association from a Company (first object type in your request URL) to an Employee [Custom Object] (second object type in your request URL). The error message you received suggests that your USER_DEFINED association type 162 does not match your attempted create association request.

    I hope this proves useful. Please let me know if you have any follow-up questions.

    Hi @Yasar 👋 Association types are directional, meaning they have a "from" object-type and a "to" object-type. You've attempted to create an association from a Company (first obj... Hi @Yasar 👋 Association types are directional, meaning they have a "from" object-type and a "to" object-type. You've attempted to create an association from a Company (first obj... Developers Feb 26, 2024 //START END-USER CONFIGURATION //------------------------------ //selectors for hover card triggers var allHoverCardTriggers = '.author-name-link,.friend-list .friend a,.username a,.avatar,.user-avatar,.author-img, .authors a, .messageauthorusername a, a.lia-user-name-link, .js-latest-post-by-from a, .user-online-list li a, a.UserAvatar, .customUsersOnline a, #authors a,.dashboard-followers a.user-name, .dashboard-following a.user-name,.author-login-wrapper a, .hb-leaderboard a, .author-img-floated'; // Forward calling page's URL params to endpoint URL as well, helps with testing! var params = (new URL(location.href)).searchParams; var userApiUrl = '/plugins/custom/hubspot/hubspot/hovercardendpoint?' + ((params.set('user_id', '') == []._) && params.toString()); if($('.hover-card-container').length<1){ $('body').append('
    '); var cardWrapper = $('.hover-card-container'); var error = false; var thisUserID = ''; var thisUserLogin = ''; var userLink =''; var cardTimer; var leaveTimer; function mouseenter(Elem) { var thisEl = Elem; cardTimer = setTimeout(function(){ var docWidth = $(document).width(); var rightSide = false; var userLink = thisEl.attr('href'); if($('.ViewProfilePage').length && $('img.lia-user-avatar-profile',thisEl).length){thisUserID = '';} else if(thisEl.attr('href')=='#' || thisEl.attr('href')=='' || !userLink.match('viewprofilepage')){ return false;} else{ var thisLen = (userLink).split('/'); thisUserID = (thisLen)[thisLen.length-1]; var thisCard = $('.profileCard[data-user='+thisUserID+']',cardWrapper); var cardId = 'userProfileCard-'+ thisUserID; var addAttr = thisEl.attr('aria-describedby',cardId); var thisElTopOffset = Math.round(thisEl.offset().top+(thisEl.height()/2)+30); var thisElbottomoffset = "auto"; var className = ""; var winHeight = $(window).height(); var elOffset = thisEl.offset(); var scrollTop = $(window).scrollTop(); var elementOffset = thisEl.offset().top; var distanceTop = (elementOffset - scrollTop); var distanceBottom = (winHeight + scrollTop) - (elOffset.top + thisEl.outerHeight(true)); var distanceLeft = Math.round(thisEl.offset().left); var bodyHight = $('body').height(); var topParam = ''; var bottomparam = ''; var position = ''; var className = 'topArrow'; cardId if(distanceBottom < 300 ){ if(distanceLeft < 59){ thisCard.removeClass('bottomArrow'); var className = 'leftArrow'; var distanceLeft = (distanceLeft)+(39); var thisElTopOffset = (thisElTopOffset)-(150); }else{ var thisElTopOffset = (thisElTopOffset)-(301); var className = 'bottomArrow'; thisCard.removeClass('topArrow'); thisCard.removeClass('leftArrow'); var distanceLeft = (distanceLeft)-(45); else{ if(distanceLeft < 59){ thisCard.removeClass('topArrow'); var className = 'leftArrow'; var distanceLeft = (distanceLeft)+(39); var thisElTopOffset = (thisElTopOffset)-(150); }else{ thisCard.removeClass('leftArrow'); thisCard.removeClass('bottomArrow').addClass('topArrow'); var distanceLeft = (distanceLeft)-(45); if(thisCard.length && $('.profileCard[data-user='+thisUserID+'] .preloader',cardWrapper).length<1){ $('.profileCard',cardWrapper).hide(); thisCard.addClass(className); rightSide?thisCard.addClass('rightArrow'):thisCard.removeClass('rightArrow'); thisCard.delay(0).css({'top':(thisElTopOffset),'left':distanceLeft,'bottom':thisElbottomoffset}).fadeIn(); } else { var ajaxReturn = ''; //just in case thisCard.remove(); //hover card wrapper markup var rightArrowClass = rightSide?'rightArrow':''; if(thisElTopOffset != "auto"){ topParam = 'px'; if(thisElbottomoffset != "auto"){ bottomparam = 'px'; var profileCardHtml = '