Zum Hauptinhalt springen
POST
/
integrators
/
timeline
/
v3
/
events
/
batch
/
create
Criar vários eventos
curl --request POST \
  --url https://api.hubapi.com/integrators/timeline/v3/events/batch/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "inputs": [
    {
      "eventTemplateId": "1001298",
      "email": "art3mis-pup@petspot.com",
      "tokens": {
        "petName": "Art3mis",
        "petAge": 3,
        "petColor": "black"
      },
      "extraData": {
        "questions": [
          {
            "question": "Who'\''s a good girl?",
            "answer": "Bark!"
          },
          {
            "question": "Do you wanna go on a walk?",
            "answer": "Woof!"
          }
        ]
      },
      "timelineIFrame": {
        "linkLabel": "View Art3mis",
        "headerLabel": "Art3mis dog",
        "url": "https://my.petspot.com/pets/Art3mis",
        "width": 600,
        "height": 400
      }
    },
    {
      "eventTemplateId": "1001298",
      "email": "pocket-tiger@petspot.com",
      "tokens": {
        "petName": "Pocket",
        "petAge": 3,
        "petColor": "yellow"
      },
      "extraData": {
        "questions": [
          {
            "question": "Who'\''s a good kitty?",
            "answer": "Purr..."
          },
          {
            "question": "Will you stop playing with that?",
            "answer": "Meow!"
          }
        ]
      },
      "timelineIFrame": {
        "linkLabel": "View Pocket",
        "headerLabel": "Pocket Tiger",
        "url": "https://my.petspot.com/pets/Pocket",
        "width": 600,
        "height": 400
      }
    }
  ]
}'
{
  "results": [
    {
      "objectType": "contacts",
      "id": "petspot:1001298:art3mis-pup@petspot.com-b9d73144-41bb-46c8-9a3f-f0849c1ad7e6",
      "eventTemplateId": "1001298",
      "email": "art3mis-pup@petspot.com",
      "objectId": "28001",
      "timestamp": "2020-01-30T18:10:17.057Z",
      "tokens": {
        "petName": "Art3mis",
        "petColor": "black",
        "petAge": "3"
      },
      "extraData": {
        "questions": [
          {
            "question": "Who's a good girl?",
            "answer": "Bark!"
          },
          {
            "question": "Do you wanna go on a walk?",
            "answer": "Woof!"
          }
        ]
      },
      "timelineIFrame": {
        "linkLabel": "View Art3mis",
        "headerLabel": "Art3mis dog",
        "url": "https://my.petspot.com/pets/Art3mis",
        "width": 600,
        "height": 400
      }
    },
    {
      "objectType": "contacts",
      "id": "petspot:1001298:pocket-tiger@petspot.com-c09a620f-60a4-46a8-be9f-fe0609fc3f0e",
      "eventTemplateId": "1001298",
      "email": "pocket-tiger@petspot.com",
      "objectId": "28651",
      "timestamp": "2020-01-30T18:10:17.057Z",
      "tokens": {
        "petName": "Pocket",
        "petColor": "yellow",
        "petAge": "3"
      },
      "extraData": {
        "questions": [
          {
            "question": "Who's a good kitty?",
            "answer": "Purr..."
          },
          {
            "question": "Will you stop playing with that?",
            "answer": "Meow!"
          }
        ]
      },
      "timelineIFrame": {
        "linkLabel": "View Pocket",
        "headerLabel": "Pocket Tiger",
        "url": "https://my.petspot.com/pets/Pocket",
        "width": 600,
        "height": 400
      }
    }
  ],
  "status": "COMPLETE",
  "startedAt": "2020-01-30T18:10:16.478734Z",
  "completedAt": "2020-01-30T18:10:17.793206Z"
}
Produtos suportados
Requer um dos seguintes produtos ou superior.
Marketing HubMarketing HubGrátis
Sales HubSales HubGrátis
Service HubService HubGrátis
Content HubContent HubStarter

Escopos Necessários

Esta API requer um dos seguintes escopos:
  • crm.schemas.contacts.write
  • crm.objects.deals.sensitive.write.v2
  • tickets
  • crm.objects.companies.highly_sensitive.write.v2
  • crm.objects.deals.highly_sensitive.write.v2
  • tickets.sensitive.v2
  • crm.objects.deals.write
  • crm.objects.companies.write
  • tickets.highly_sensitive.v2
  • crm.schemas.deals.write
  • crm.objects.companies.sensitive.write.v2
  • crm.objects.contacts.write
  • crm.schemas.companies.write
  • crm.objects.contacts.highly_sensitive.write.v2
  • crm.objects.contacts.sensitive.write.v2
  • timeline

Authorizations

Authorization
string
header
required

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

Body

application/json

The timeline event definition.

Used to create timeline events in batches.

inputs
object[]
required

Uma coleção de eventos de linha do tempo que queremos criar.

Example:

"[{\"email\":\"art3mis-pup@petspot.com\",\"tokens\":{\"petAge\":3,\"petName\":\"Art3mis\",\"petColor\":\"black\"},\"extraData\":{\"questions\":[{\"answer\":\"Bark!\",\"question\":\"Who's a good girl?\"},{\"answer\":\"Woof!\",\"question\":\"Do you wanna go on a walk?\"}]},\"timelineIFrame\":{\"url\":\"https://my.petspot.com/pets/Art3mis\",\"width\":600,\"height\":400,\"linkLabel\":\"View Art3mis\",\"headerLabel\":\"Art3mis dog\"},\"eventTemplateId\":\"1001298\"},{\"email\":\"pocket-tiger@petspot.com\",\"tokens\":{\"petAge\":3,\"petName\":\"Pocket\",\"petColor\":\"yellow\"},\"extraData\":{\"questions\":[{\"answer\":\"Purr...\",\"question\":\"Who's a good kitty?\"},{\"answer\":\"Meow!\",\"question\":\"Will you stop playing with that?\"}]},\"timelineIFrame\":{\"url\":\"https://my.petspot.com/pets/Pocket\",\"width\":600,\"height\":400,\"linkLabel\":\"View Pocket\",\"headerLabel\":\"Pocket Tiger\"},\"eventTemplateId\":\"1001298\"}]"

Response

The response is of type any.

I