# Keep get error 403 forbidden

**URL:** <https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471>\
**Category:** API\
**Created:** [October 18, 2024, 10:48am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471 "2024-10-18T10:48:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejsjjdn](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@ejsjjdn](https://discuss.dev.twitch.com/u/ejsjjdn)\
**Post date:** [October 18, 2024, 10:48am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471/1 "2024-10-18T10:48:33Z")

</div>

just cant write in chat. Get bearer\_token with  
#access\_token=&scope=channel%3Abot+user%3Abot+user%3Awrite%3Achat+moderator%3Amanage%3Aannouncements&token\_type=bearer

Was able to get follower list with another token and code, but this 2 didn’t work

```auto
import requests

client_id = '3gpdymotr4fxjg6jr05eiszf9tz3b5'
bearer_token = ''
broadcaster_id = 861649060

url = 'https://api.twitch.tv/helix/chat/announcements?broadcaster_id=861649060&moderator_id=861649060'

headers = {
    'Authorization' : f'Bearer {bearer_token}',
    'Client-Id' : f'{client_id}',
    'Content-Type' : 'application/json'
}
data = {
    'message' : 'Hello, world! twitchdevHype',
    'color' : 'purple'
    }

response = requests.get(url, headers=headers, data=data)

if response.status_code == 200:
    response_data = response.json()
    print(f"Message ID: {response_data['data'][0]['message_id']}, Sent: {response_data['data'][0]['is_sent']}")
else:
    print(f"Error: {response.status_code}, {response.text}")

```

and

```auto
import requests

client_id = '3gpdymotr4fxjg6jr05eiszf9tz3b5'
bearer_token = ''
broadcaster_id = 861649060

url = 'https://api.twitch.tv/helix/chat/messages'

headers = {
    'Authorization' : f'Bearer {bearer_token}',
    'Client-Id' : f'{client_id}',
    'Content-Type' : 'application/json'
}
data = {
    'broadcaster_id': f'{broadcaster_id}',
    'sender_id' : f'{broadcaster_id}',
    'message' : 'Hello, world! twitchdevHype'
    }

response = requests.get(url, headers=headers, data=data)

if response.status_code == 200:
    response_data = response.json()
    print(f"Message ID: {response_data['data'][0]['message_id']}, Sent: {response_data['data'][0]['is_sent']}")
else:
    print(f"Error: {response.status_code}, {response.text}")

```

Already try to create new token, but 403 ☹

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [October 18, 2024, 10:49am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471/2 "2024-10-18T10:49:42Z")

</div>

> [@ejsjjdn](#):
>
> Already try to create new token, but 403 ☹

What is the body of the response?

The HTTP code is half the information, the body should contain a descriptive error

---

<div class="post-metadata">

**Author:** ![ejsjjdn](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@ejsjjdn](https://discuss.dev.twitch.com/u/ejsjjdn)\
**Post date:** [October 18, 2024, 10:50am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471/3 "2024-10-18T10:50:11Z")

</div>

ERROR: The request could not be satisfied

# 403 ERROR

## The request could not be satisfied.

* * *
Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.  
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.  

* * *

```
Generated by cloudfront (CloudFront)
Request ID: a2_1hT80gOikEGpqugl8BqX8Cl-nI7aZ0p0qo6S0wz5IiO_IUs8M8g==
```

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [October 18, 2024, 10:51am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471/4 "2024-10-18T10:51:40Z")

</div>

> [@ejsjjdn](#):
>
> ERROR: The request could not be satisfied
> 
> # 403 ERROR
> 
> ## The request could not be satisfied.

You’ve tried to send a body with a GET request

> [@ejsjjdn](#):
>
> `response = requests.get(url, headers=headers, data=data)`

Both of these should be POST requests not GET requests

Docs: [Reference | Twitch Developers](https://dev.twitch.tv/docs/api/reference/#send-chat-announcement) and  
[Reference | Twitch Developers](https://dev.twitch.tv/docs/api/reference/#send-chat-message) show the use of the POST verb in the URL and example.

You’ve done a GET request instead

---

<div class="post-metadata">

**Author:** ![ejsjjdn](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@ejsjjdn](https://discuss.dev.twitch.com/u/ejsjjdn)\
**Post date:** [October 18, 2024, 11:02am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471/5 "2024-10-18T11:02:23Z")

</div>

Thanks a lot, I didn’t think that I’m that blind.

---

<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:** [November 17, 2024, 11:02am UTC](https://discuss.dev.twitch.com/t/keep-get-error-403-forbidden/61471/6 "2024-11-17T11:02:50Z")

</div>

Closed on November 17, 2024, 11:02am UTC

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