# Creating a clip at a precise moment with a bot?

**URL:** <https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061>\
**Category:** API\
**Created:** [January 29, 2017, 8:28am UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061 "2017-01-29T08:28:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fezr2910](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@Fezr2910](https://discuss.dev.twitch.com/u/Fezr2910)\
**Post date:** [January 29, 2017, 8:28am UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061/1 "2017-01-29T08:28:38Z")

</div>

Hello,

I’m trying to create a bot that is able to create a clip at a precise moment and give back the URL of the clip. Does the API support this feature ?

---

<div class="post-metadata">

**Author:** ![Felk](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/felk/32/1690_2.png) [@Felk](https://discuss.dev.twitch.com/u/Felk)\
**Post date:** [January 29, 2017, 5:57pm UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061/2 "2017-01-29T17:57:17Z")

</div>

clips get created by POSTing to `https://clips.twitch.tv/clips` with this data:

```
{
    "player_backend_type": "player_core",
    "channel": "name_of_the_channel",
    "offset": "1234",
    "broadcast_id": "12345678",
    "vod_id": "",
    "play_session_id": "76cfad875fb8b5b6c76d55db76df"
}

```

This is undocumented, probably not meant for 3rd party use, and I haven’t tried it. But I can tell you this from observation:

- `offset` is in seconds, since the start of the broadcast or the vod
- only `broadcast_id` or `vod_id` gets submitted, depending on what you create the clip from. the `vod_id` is the same that is in the url, so no surprise there
- `play_session_id` apparently is a random token. I haven’t looked at how it gets acquired, and doing the above request always returned a 500 error for me so far.

So to get this to work, it needs a bit more investigation

---

<div class="post-metadata">

**Author:** ![Fezr2910](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@Fezr2910](https://discuss.dev.twitch.com/u/Fezr2910)\
**Post date:** [January 29, 2017, 6:35pm UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061/3 "2017-01-29T18:35:17Z")

</div>

Thanks a lot ! So I have my Java program and I should make a POST request to the url you gave me and then transmit the data in the brackets ? Can you give me an example ?

---

<div class="post-metadata">

**Author:** ![Felk](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/felk/32/1690_2.png) [@Felk](https://discuss.dev.twitch.com/u/Felk)\
**Post date:** [January 29, 2017, 7:15pm UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061/4 "2017-01-29T19:15:55Z")

</div>

No. As I said, I didn’t get it to work, and I don’t plan on figuring it out and writing a Java tutorial on it, sorry

---

<div class="post-metadata">

**Author:** ![Fezr2910](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@Fezr2910](https://discuss.dev.twitch.com/u/Fezr2910)\
**Post date:** [January 29, 2017, 7:47pm UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061/5 "2017-01-29T19:47:41Z")

</div>

Ok that’s nice you answered 😃 I know where to dig in now.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [February 28, 2017, 7:47pm UTC](https://discuss.dev.twitch.com/t/creating-a-clip-at-a-precise-moment-with-a-bot/9061/6 "2017-02-28T19:47:48Z")

</div>

Closed on February 28, 2017, 7:47pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
