[Could not authenticate you] post direct_messages/welcome_messages/new


#1

Sorry for the following in google translation.
I’d like to create a direct message chat bot using the API,
A response that looks like authentication failure is returned and the welcome message can not be registered.
https://developer.twitter.com/en/docs/direct-messages/welcome-messages/guides/setting-default-welcome-message

request
{“name”: “simple_welcome-message 01”, “welcome_message”: {“message_data”: {“text” “twist” : “hello”}}} ’

response
{“errors”: [{“code”: 32, “message”: “Could not authenticate you.”}]}

A question
Do I need special settings and permissions to use this API? (The use of direct message is set on the setting screen of the application)

  • The Twitter account you use is a regular personal account.

#2

There’s no requirement for special permissions here (apart from the access to Direct Messages option in the app permissions). This sounds like your OAuth headers are not set correctly. Here’s an example of using twurl to set a welcome message.


#3

Very Thanks!,and sorry.
I tryed ```twurl accounts```` and I see lots of Invalid keys…
I delete and reset default account.
Then I can regist welcome message.
Thaks!!!


#5