# Importing Notes or Posting Imported data on Activity per Contact

**URL:** <https://community.hubspot.com/t/importing-notes-or-posting-imported-data-on-activity-per-contact/65418>\
**Category:** APIs & Integrations\
**Tags:** python, starter\
**Created:** [September 20, 2022, 4:39am UTC](https://community.hubspot.com/t/importing-notes-or-posting-imported-data-on-activity-per-contact/65418 "2022-09-20T04:39:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JDiaz22](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@JDiaz22](https://community.hubspot.com/u/JDiaz22)\
**Post date:** [September 20, 2022, 4:39am UTC](https://community.hubspot.com/t/importing-notes-or-posting-imported-data-on-activity-per-contact/65418/1 "2022-09-20T04:39:25Z")

</div>

Hi all im new to this community and wanted to as something about how to import notes:

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-notes-v3%2Fguide)**

im using above guides to try to import notes and getting response but its not updating the notes on my contacts

`import requestsimport jsonurl = "https://api.hubapi.com/crm/v3/objects/notes/batch/create"headers = { 'Content-Type': "application/json", 'Authorization': 'Bearer "bearer here" ' }payload = json.dumps( { "inputs": [{ "id": "id here", "properties": { "hs_note_body": "Test 4", "hubspot_owner_id": "id here " } }] });response = requests.request("POST", url, data=payload, headers=headers)print(response.text)`

One thing that i tried and works is the legacy engagement which is straight forward and working. my problem here is i dont know how to post a unique notes per contacts.

[https://legacydocs.hubspot.com/docs/methods/engagements/create\_engagement](https://legacydocs.hubspot.com/docs/methods/engagements/create_engagement)

`import requestsimport jsonurl_notes = "https://api.hubapi.com/engagements/v1/engagements"payload = json.dumps({ "engagement": { "active": 'true', "ownerId": 111, "type": "NOTE" }, "associations": { "contactIds": ['222','333'] }, "metadata": { "body": "test3" }});headers = { 'Content-Type': "application/json", 'Authorization': 'Bearer "bearer here" ' }response = requests.request("POST", url_notes, data=payload, headers=headers)print(response.text)`

Im not sure if there are better ways aside from what i tried above. but my main goal is to post on activity on each contacts.

 ![JDiaz22_0-1663648693420.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/d/ad050f57b53a98ffd54465c499856774767879b5.png)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 20, 2022, 8:49pm UTC](https://community.hubspot.com/t/importing-notes-or-posting-imported-data-on-activity-per-contact/65418/2 "2022-09-20T20:49:39Z")

</div>

Hey, @JDiaz22 👋 I am mostly clear on your goal. Please correct me if I am wrong or miss anything.

You are correct, the [v1 version](https://legacydocs.hubspot.com/docs/methods/engagements/create_engagement) of this endpoint allows you to create the note and associate it to a Contact in a single call. Here’s a quick test:

Request

```lia-code-sample
POST https://api.hubapi.com/engagements/v1/engagements

JSON Body
{
 "engagement": {
 "active": true,
 "type": "NOTE",
 "timestamp": 1658247956001
 },
 "associations": {
 "contactIds": [
 301
 ]
 },
 "metadata": {
 "body": "Tacos!"
 }
}

```

Response

```lia-code-sample
{
 "associationCreateFailures": [],
 "engagement": {
 "id": 25871672710,
 "portalId": 22245342,
 "active": true,
 "createdAt": 1663705895783,
 "lastUpdated": 1663705895783,
 "type": "NOTE",
 "timestamp": 1658247956001,
 "allAccessibleTeamIds": [],
 "bodyPreview": "Tacos!",
 "queueMembershipIds": [],
 "bodyPreviewIsTruncated": false,
 "bodyPreviewHtml": "<html>\n <head></head>\n <body>\n Tacos!\n </body>\n</html>"
 },
 "associations": {
 "contactIds": [
 301
 ],
 "companyIds": [],
 "dealIds": [],
 "ownerIds": [],
 "workflowIds": [],
 "ticketIds": [],
 "contentIds": [],
 "quoteIds": []
 },
 "attachments": [],
 "metadata": {
 "body": "Tacos!"
 }
}

```

 ![CleanShot 2022-09-20 at 14.41.53.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/e/3e90a86de334bc7ba06c54c240e8679e51d532aa.png)

Otherwise, the [v3 Engagements \> Notes](https://developers.hubspot.com/docs/api/crm/notes) endpoints allow for the same result, but requires the creation and the association to be split into two calls:

1. 

`POST /crm/v3/objects/notes`

1. 

`PUT /crm/v3/objects/notes/{noteId}/associations/{toObjectType}/{toObjectId}/{associationType}`

Please note, the Legacy endpoints should be considered _stable_ and _supported_ unless explicitly noted on the endpoint page. In this case, if the legacy endpoint works for you and your goal, you can be confided it is supported and maintained.

Have fun building! — Jaycee

---

<div class="post-metadata">

**Author:** ![JDiaz22](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@JDiaz22](https://community.hubspot.com/u/JDiaz22)\
**Post date:** [September 21, 2022, 12:22am UTC](https://community.hubspot.com/t/importing-notes-or-posting-imported-data-on-activity-per-contact/65418/3 "2022-09-21T00:22:45Z")

</div>

hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) thank you very much for the response! was actually looking for way to batch update the notes on multiple contacts and the v1/engagements (if im correct about it) only allows one a time and will require a loop and consume alot of request.post().  
was looking for a sample on how to use the /objects/notes since when i tried to post something it response error but nothing happend, i assume my payload or somewhere on my script is incorrect. But as you mentioned on your repl it seems im doing it incorrectly.  
below is the script that i tried before i tested posting here, if its possible to draft a correct sample from below template i would highly appreciate it

`import requestsimport jsonurl = "https://api.hubapi.com/crm/v3/objects/notes/batch/create"headers = { 'Content-Type': "application/json", 'Authorization': 'Bearer "bearer here" ' }payload = json.dumps( { "inputs": [{ "id": "id 1 here", "properties": { "hs_note_body": "Test 4", "hubspot_owner_id": "id here " } }, { "id": "id 2 here ", "properties": { "hs_note_body": "Test 4", "hubspot_owner_id": "id here " } }] });`
