# Getting Unauthorized Client ID and OAuth token do not match when using the webhook endpoint

**URL:** <https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590>\
**Category:** API\
**Created:** [December 20, 2020, 12:12pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590 "2020-12-20T12:12:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oriel\_beck](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/oriel_beck/32/10948_2.png) [@oriel\_beck](https://discuss.dev.twitch.com/u/oriel_beck)\
**Post date:** [December 20, 2020, 12:12pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590/1 "2020-12-20T12:12:11Z")

</div>

I use axios to get the endpoint, my code is:  
let access\_token = ‘Bearer XXXXXXXXXX’

```
            let client_id = 'khXXXXXXXXXXXXXXXXXXXXXXXXXXXX85'

            const applications = axios.create({

                baseURL: 'https://api.twitch.tv/helix/webhooks',

                headers: {'Client_ID': client_id, 'Authorization': access_token, 'Content-Type': 'application/json'}

            })

            applications.post('/hub', {

                    "hub.callback": 'https://localhost',

                    "hub.mode": "subscribe",

                    "hub.topic": "https://api.twitch.tv/helix/streams?user_id=5XXXXXX6",

                    "hub.lease_seconds": 864000,

                    "hub.secret": "XXXXXXXXX!",

            }).then(d => console.log(d)).catch(err => console.log(err))

```

I got the acces token a few minutes before, it’s working wth other requests (such as the channels endpoint) but not with this one, what am i doing wrong?

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [December 20, 2020, 12:23pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590/2 "2020-12-20T12:23:28Z")

</div>

Your client id header is wrong, it should be `Client-ID`, not `Client_ID`. The reason you’re getting a do not match error is because Twitch isn’t detecting your Client ID at all.

Also, you can’t use localhost as a callback for Webhooks or EventSub as that’s not a reachable destination for Twitch.

---

<div class="post-metadata">

**Author:** ![oriel\_beck](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/oriel_beck/32/10948_2.png) [@oriel\_beck](https://discuss.dev.twitch.com/u/oriel_beck)\
**Post date:** [December 20, 2020, 12:35pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590/3 "2020-12-20T12:35:33Z")

</div>

Thank you very much for the fast response, do you have any recommended places to temporarily target that callback untill I set something up?

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [December 20, 2020, 12:40pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590/4 "2020-12-20T12:40:07Z")

</div>

The callback URL needs to be wherever you’ve set up your web server, and needs to be publicly accessible, (it also needs to be HTTPS for EventSub, or any webhook topics that require user scopes).

So you could host the webserver yourself and forward any ports needed to that so you can use your public IP as a callback URL, but honestly the best place to test would be wherever you actually plan to be running your app in production.

---

<div class="post-metadata">

**Author:** ![oriel\_beck](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/oriel_beck/32/10948_2.png) [@oriel\_beck](https://discuss.dev.twitch.com/u/oriel_beck)\
**Post date:** [December 20, 2020, 12:42pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590/5 "2020-12-20T12:42:20Z")

</div>

Thx, then I’ll make a webserver on the vps before I test this on it, again, thx for the help 😊

---

<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:** [January 19, 2021, 12:42pm UTC](https://discuss.dev.twitch.com/t/getting-unauthorized-client-id-and-oauth-token-do-not-match-when-using-the-webhook-endpoint/29590/6 "2021-01-19T12:42:24Z")

</div>

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