Twitter
Twitter account registration
If you do not have a Twitter account, register it. You will receive a verification code on your email address or on your mobile phone. Enter it during authorisation. Then you should set a password.Your page is ready.
Twitter API settings
1. Go to https://apps.twitter.com/
2. Click Create an App
3. Click Apply
4. Fill in the fields:
Your country
Exploring the API
No
5. Click Let's do this
6. Confirm the Developer agreement & policy – click Submit
7. Verify your email – click Confirm your email on the mail on your email
8. Fill in Application Name and click Get keys
9. Copy and save the next fields:
API Keys
API Key Secret
10. Click Dashbords
11. Click Yes, I saved them
12. Go to the Project & Apps tab and select Project 1
13. Click Apply to take Elevated access
14. Fill in the fields as you wish and click Next
15. Fill in text fields by a short describtion how will you use Twitter API
16. Set the checkboxes as on the picture below:
Are you planning to analyze Twitter data? – No
Will your App use Tweet, Retweet, Like, Follow, or Direct Message functionality? – Yes
Do you plan to display Tweets or aggregate data about Twitter content outside Twitter? – No
Will your product, service, or analysis make Twitter content or derived information available to a government entity? – No
17. Click Next
18. Check your data and Click Next
19. Confirm the Developer agreement & policy – click Submit
20. Go to the Project & Apps tab, select ypur application and click Set up for user authentication settings
21. Select Read and write and Direct message
22. Select Web App, Automated App or Bot
23. Fill in the fields:
Callback URI / Redirect URL – the value of any URL, for example https://balance.beesender.com/
Website URL – the value of any URL, for example https://balance.beesender.com/
24. Click Save
25. Click Yes
26. Click Done
27. Click Yes, I saved it
28. Go to the Products tab and select Dev Environment
29. Click Set up dev environment
30. Fill in the fields:
Dev environment label – значение на усмотрение, необходимо заполнить для следующих шагов
App – выберите своё приложение
31. Click Complete setup
32. Go to the Project tab and select your application
33. Go to the Keys and Tokens tab
34. Click Generate near Access Token and Secret
35. Copy and save the next fields:
Access Token
Access Token Secret
36. Click Yes, I saved them
37. Go to your Twitter account – you can select your profile and click Go to Twitter
38. Click More
39. Select Security and account access
40. Select Apps and sessions
41.Click Connected App
42. Check if your application exists
43. Go to the Setting and priority tab
44. Select Privacy and safety
45. Select Direct Message
46. Set the checkbox Allow message requests from everyone
Add Twitter channel to Creatio
Preparatory stage. The Creatio system to which you plan to connect Instagram Direct must have the current Beesender package installed. You can install Beesender from the Creatio marketplace by following this link.
1. Go to the System designer > Chat configuration > Channels
2. Click + and select Twitter
3. Fill in the fields:
Add twitter channel | |
---|---|
Channel name | Channel name as you wish |
AccessToken | Access Token (p.35) |
AccessSecret | Access Token Secret (p.35) |
ConsumerKey | API Key |
ConsumerSecret | API Key Secret |
EnvironmentName | dev (label at p.30) |
Chat weight | 1 |
4. Click Add
Error 500
If an error occurs, you must regenerate the token keys and fill in the fields with new values:
1. Go to: Developer portal
2. Select Projects & Apps tab
3. Select your application
4. Go to the Keys and tokens tab
5. Click Regenerate near API Key and Secret
6. Click Yes, regenerate
7. Copy the API Key and set it in the ConsumerKey field in the Creatio
8. Copy the API Key Secret and set it in theConsumerKey field in the Creatio
9. Go back to Developer portal and click Yes, I saved them
10. Click Regenerate near Access Token and Secret
11. Click Yes, regenerate
12. Copy the Access Token and set it in the the Access Token field in the Creatio
13. Copy the Access Token Secret and set it in the the AccessSecretfield in the Creatio
14. Click ADD
Add twitter channel | |
---|---|
Channel name | Channel name as you wish |
AccessToken | Access Token |
AccessSecret | Access Token Secret |
ConsumerKey | API Key |
ConsumerSecret | API Key Secret |
EnvironmentName | dev |
Chat weight | 1 |
Message Exchange via X API
Message exchange via X API is the set of 2 requests:
1. Sending Messages via Beesender Connector
Our service (Beesender Connector) sends the following request to X API when an agent from Creatio workplace sends a message to a client:
POST /2/dm_conversations/with/:participant_id/messages
This endpoint has its own limitations (https://developer.x.com/en/portal/products/basic):
As you can see, for the Basic plan, the limitation is 1 request per 24 hours per user.
This means that your agent will be able to answer your client only with one message per 24 hours.
2. Receiving Messages from Clients via X API
X API sends client messages to our Connector.
2.1. Real-Time Message Transport
If we want to transport your clients' messages to your agents in real-time, we need to use the X service named Account Activity API. Only this service provides the ability to use webhooks (https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/account-activity ).
It requires an Enterprise plan.
The cost is approximately $42,000 per month.
2.2. Delayed Message Retrieval
If some delay between your clients’ messages and your agents’ reactions is acceptable, we can periodically send the request:
GET /2/dm_events
to check for new messages from clients. However, our service will only be able to retrieve the last 100 messages (https://docs.x.com/x-api/direct-messages/get-recent-dm-events , see limitations for max_results parameter) per request.
If there are more than 100 messages (incoming or outgoing) between our check requests, all messages beyond that limit will be lost.
The limitation for these check requests:
In the Basic plan, we can check messages only once per 24 hours.
If you have more than 100 messages per minute (clients and agents), even the Pro plan is not for you.
For stable and reliable integration with X chats, you need to pay for the Enterprise plan.
The Pro plan may be an option, but this type of integration will require complex configurations, increasing the chances of malfunctioning.Sorry, but Elon Musk has made every possible effort to turn Twitter into the most inappropriate platform for barrierless communication between businesses and their clients.