Zum Hauptinhalt springen
POST
/
crm
/
v4
/
associations
/
{fromObjectType}
/
{toObjectType}
/
batch
/
create
Créer
curl --request POST \
  --url https://api.hubapi.com/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "inputs": [
    {
      "types": [
        {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 123
        }
      ],
      "from": {
        "id": "<string>"
      },
      "to": {
        "id": "<string>"
      }
    }
  ]
}'
{
  "completedAt": "2023-11-07T05:31:56Z",
  "numErrors": 123,
  "requestedAt": "2023-11-07T05:31:56Z",
  "startedAt": "2023-11-07T05:31:56Z",
  "links": {},
  "results": [
    {
      "fromObjectTypeId": "<string>",
      "toObjectId": "<string>",
      "toObjectTypeId": "<string>",
      "fromObjectId": "<string>",
      "labels": [
        "<string>"
      ]
    }
  ],
  "errors": [
    {
      "subCategory": {},
      "context": {},
      "links": {},
      "id": "<string>",
      "category": "<string>",
      "message": "<string>",
      "errors": [
        {
          "subCategory": "<string>",
          "code": "<string>",
          "in": "<string>",
          "context": "{\"missingScopes\":[\"scope1\",\"scope2\"]}",
          "message": "<string>"
        }
      ],
      "status": "<string>"
    }
  ],
  "status": "PENDING"
}

Produits pris en charge

Exige l'un des produits suivants ou un produit supérieur.
Marketing HubMarketing Hub -Gratuit
Sales HubSales Hub -Gratuit
Service HubService Hub -Gratuit
Content HubContent Hub -Starter
Cette API requiert l'une des portées suivantes :
crm.objects.appointments.read
crm.objects.appointments.sensitive.read.v2
crm.objects.appointments.sensitive.write.v2
crm.objects.appointments.write
crm.objects.carts.read
crm.objects.carts.write
crm.objects.commercepayments.read
crm.objects.commercepayments.write
crm.objects.companies.highly_sensitive.read.v2
crm.objects.companies.highly_sensitive.write.v2
crm.objects.companies.read
crm.objects.companies.sensitive.read.v2
crm.objects.companies.sensitive.write.v2
crm.objects.companies.write
crm.objects.contacts.highly_sensitive.read.v2
crm.objects.contacts.highly_sensitive.write.v2
crm.objects.contacts.read
crm.objects.contacts.sensitive.read.v2
crm.objects.contacts.sensitive.write.v2
crm.objects.contacts.write
crm.objects.courses.read
crm.objects.courses.write
crm.objects.custom.highly_sensitive.read.v2
crm.objects.custom.highly_sensitive.write.v2
crm.objects.custom.read
crm.objects.custom.sensitive.read.v2
crm.objects.custom.sensitive.write.v2
crm.objects.custom.write
crm.objects.deals.highly_sensitive.read.v2
crm.objects.deals.highly_sensitive.write.v2
crm.objects.deals.read
crm.objects.deals.sensitive.read.v2
crm.objects.deals.sensitive.write.v2
crm.objects.deals.write
crm.objects.goals.read
crm.objects.goals.write
crm.objects.invoices.read
crm.objects.invoices.write
crm.objects.leads.read
crm.objects.leads.write
crm.objects.line_items.read
crm.objects.line_items.write
crm.objects.listings.read
crm.objects.listings.write
crm.objects.orders.read
crm.objects.orders.write
crm.objects.partner-clients.read
crm.objects.partner-clients.write
crm.objects.partner-services.read
crm.objects.partner-services.write
crm.objects.products.read
crm.objects.products.write
crm.objects.quotes.read
crm.objects.quotes.write
crm.objects.services.read
crm.objects.services.write
crm.objects.subscriptions.read
crm.objects.subscriptions.write
crm.objects.users.read
crm.objects.users.write
e-commerce
media_bridge.read
tickets
tickets.highly_sensitive.v2
tickets.sensitive.v2

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

fromObjectType
string
required

Type of the toObject for this association definition (ex. "0-2")

toObjectType
string
required

Type of the fromObject for this association definition (ex. "0-1")

Body

application/json
inputs
object[]
required

Response

successful operation

completedAt
string<date-time>
required
startedAt
string<date-time>
required
results
object[]
required
status
enum<string>
required
Available options:
PENDING,
PROCESSING,
CANCELED,
COMPLETE
numErrors
integer
requestedAt
string<date-time>
errors
object[]
I