# Adding Media to Twitter API V2 with HTTP Node

**URL:** <https://community.n8n.io/t/adding-media-to-twitter-api-v2-with-http-node/27396>\
**Category:** Questions\
**Tags:** http-request, external-api\
**Created:** [23. Juni 2023 um 06:09 UTC](https://community.n8n.io/t/adding-media-to-twitter-api-v2-with-http-node/27396 "2023-06-23T06:09:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![mmac](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mmac](https://community.n8n.io/u/mmac)\
**Post date:** [23. Juni 2023 um 06:09 UTC](https://community.n8n.io/t/adding-media-to-twitter-api-v2-with-http-node/27396/1 "2023-06-23T06:09:29Z")

</div>

I’ve followed this to upload an image to Twitter via the 1.1 API: [Tweet image - media type unrecognised - #2 by MutedJam](http://community.n8n.io/t/tweet-image-media-type-unrecognised/16914/2)

As we all know, the 1.1 API is no longer available to post Tweets, so the method used in this example to attach the media (media\_ids) to an actual tweet doesn’t work with Twitter API V2.

I’ve found this: [How to show an image in a v2 api tweet? - #5 by cloudworxx - Media APIs - Twitter Developers](https://twittercommunity.com/t/how-to-show-an-image-in-a-v2-api-tweet/163169/5)

Which says you need to format the media\_ids inside a “media” field:

```auto
{"text": "Tweeting with media!", "media": {"media_ids": ["1455952740635586573"]}}

```

But I’m not sure how to do this with n8n using JSON and the “Using the fields below” boxes. I realize I can format the JSON from scratch, but that will screw up all the formatting in the tweet itself, and among many, many workflows, will create a lot of work for me to fix. I’m hoping there’s a way to make this work with the pre-defined boxes in n8n.

Here’s what I have. I don’t know what to put in the boxes under “name” and “value” for the media\_id\_string to make the media nest as Twitter API V2 requires.

I’ve tried dot notation and a colon, like “media.media\_ids” and “media:media\_ids” but (obviously) those didn’t work.

---

_[View the full topic](https://community.n8n.io/t/adding-media-to-twitter-api-v2-with-http-node/27396)._
