Today we’re updating the Direct Messages experience1 on the Twitter iPhone app, Android app and Twitter.com to enable users to create private conversations on Twitter more easily. More specifically, we are giving users the option to receive DMs from anyone, and to always be able to reply once a message is received.
We believe these features are useful for a variety of use cases. Journalists and newsrooms can open up a more private, direct relationship to their viewers and constituencies. Likewise, brands can offer their customers faster and more responsive support.
These changes will be reflected via the API as well, with no additional development necessary on your part. When sending DMs, the API will simply respect the user’s setting of accept/don’t accept DMs from anyone.
A few specific behaviors in the API to note, for advanced developers:
-
The account settings object has an allow_dms_from field which
indicates who can DM a user, either in a private one-on-one thread or
in a group thread. Possible values include “following” (only users
you are following are allowed to DM you) and “anyone” (allow any user
on Twitter to DM you). -
The API endpoint /account/settings.json allows the logged in user to
set the values for allow_dms_from. This endpoint returns the
current values as well. Editing this permission requires the “Read,
Write and Access direct messages” permission in you app. An example request and response are below. -
To prevent DMs from a particular user, you must block that user. This
removes the user-to-user association on our side, preventing future
DMs. A following un-block will still respect the no-DM state.un-block
will still respect the no-DM state.
Updates to dev.twitter.com documentation to come shortly.
POST Request:
https://api.twitter.com/1.1/account/settings.json?allow_dms_from=anyone
HTTP Response:
{
"sleep_time": {
"end_time": null,
"enabled": false,
"start_time": null
},
"use_cookie_personalization": true,
"trend_location": [{
"name": "San Francisco",
"placeType": {
"name": "Town",
"code": 7
},{
"woeid": 2487956,
"country": "United States",
"url": "http://where.yahooapis.com/v1/place/2487956",
"countryCode": "US",
"parentid": 23424977
}],
"language": "en",
"discoverable_by_email": true,
"always_use_https": true,
"protected": false,
"geo_enabled": true,
"show_all_inline_media": false,
"screen_name": "oauth_dancer",
"allow_dms_from": "anyone"
}
출처 : https://twittercommunity.com/t/api-updates-for-direct-messages-rules/36061
'Story > api/연동' 카테고리의 다른 글
네이버 지식쇼핑 EP 3.0 (1) | 2016.12.12 |
---|---|
hotmail.com 으로 메일 발송이 안될때 (0) | 2016.06.10 |
다음 api 를 이용한 지도 만들기 (사용자 이미지를 이용한 마커 / 컨크롤 올리기) (0) | 2015.10.13 |
다음 약도만들기 지도 서비스 (0) | 2015.09.23 |
알리페이 alipay Integration Guide (0) | 2015.05.12 |