Hi,
Note: @davidsimpson227 is following @Value1stConnect, but @Value1stConnect is not following @davidsimpson227
This is one tweet recieved, for my @Value1stConnect from @davidsimpson227.
I am using “id”:“747729060416086016” while sending the reply to this tweet. The Json which I am sending to my restpi which in turns post this reply are given below
Tweet Recieved
{
"rateLimitStatus": null,
"accessLevel": 0,
"createdAt": 1467107474000,
"id": 747729060416086016,
"text": "@davidsimpson227 hello, how are you?",
"source": "<a href=\"http://www.valuefirst.com\" rel=\"nofollow\">ValueFirstInsu</a>",
"inReplyToStatusId": -1,
"inReplyToUserId": 570573922,
"favoriteCount": 0,
"inReplyToScreenName": "davidsimpson227",
"geoLocation": null,
"place": null,
"retweetCount": 0,
"lang": "en",
"retweetedStatus": null,
"userMentionEntities": [
{
"start": 0,
"end": 16,
"name": "David Simpson",
"screenName": "davidsimpson227",
"id": 570573922,
"text": "davidsimpson227"
}
],
"hashtagEntities": [],
"mediaEntities": [],
"extendedMediaEntities": [],
"symbolEntities": [],
"currentUserRetweetId": -1,
"scopes": null,
"user": {
"rateLimitStatus": null,
"accessLevel": 0,
"id": 2905117489,
"name": "Value First Insuranc",
"screenName": "Value1stConnect",
"location": "",
"description": "",
"descriptionURLEntities": [],
"url": null,
"followersCount": 3,
"status": null,
"profileBackgroundColor": "C0DEED",
"profileTextColor": "333333",
"profileLinkColor": "0084B4",
"profileSidebarFillColor": "DDEEF6",
"profileSidebarBorderColor": "C0DEED",
"profileUseBackgroundImage": true,
"showAllInlineMedia": false,
"friendsCount": 2,
"createdAt": 1416484627000,
"favouritesCount": 0,
"utcOffset": -25200,
"timeZone": "Pacific Time (US & Canada)",
"profileBackgroundImageUrlHttps": "https://abs.twimg.com/images/themes/theme1/bg.png",
"profileBackgroundTiled": false,
"lang": "en",
"statusesCount": 37,
"translator": false,
"listedCount": 0,
"withheldInCountries": null,
"protected": false,
"defaultProfile": true,
"geoEnabled": false,
"verified": false,
"urlentity": {
"start": 0,
"end": 0,
"url": "",
"expandedURL": "",
"displayURL": "",
"text": ""
},
"contributorsEnabled": false,
"profileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
"biggerProfileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1_bigger.png",
"miniProfileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1_mini.png",
"profileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
"defaultProfileImage": true,
"profileBannerURL": null,
"profileBannerIPadURL": null,
"followRequestSent": false,
"originalProfileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1.png",
"biggerProfileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1_bigger.png",
"miniProfileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1_mini.png",
"originalProfileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1.png",
"profileBackgroundImageURL": "http://abs.twimg.com/images/themes/theme1/bg.png",
"profileBannerRetinaURL": null,
"profileBannerIPadRetinaURL": null,
"profileBannerMobileURL": null,
"profileBannerMobileRetinaURL": null
},
"withheldInCountries": null,
"quotedStatus": null,
"quotedStatusId": -1,
"contributors": [],
"possiblySensitive": false,
"retweet": false,
"retweeted": false,
"favorited": false,
"truncated": false,
"urlentities": [],
"retweetedByMe": false
}
Json Sent To Rest API
{
"msg":"@davidsimpson227 Very Good Morning David",
"inReplyToStatusId":"747729060416086016"
}
Rest API Method Using Twitter4J (Snippet)
@RequestMapping(value="/reply",method=RequestMethod.POST,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Status> replyTweet(@RequestBody TweetMessage msg)
throws TwitterException
{
StatusUpdate tweetData=new StatusUpdate(msg.getMsg());
tweetData.setInReplyToStatusId(msg.getInReplyToStatusId());
Status tweet=twitter.updateStatus(tweetData);
return new ResponseEntity<Status>(tweet,HttpStatus.OK);
}
The reply is sent, but the @davidsimpson227 has received it as tweet.
Response Received Againts Above Reply Sent
{
"rateLimitStatus": null,
"accessLevel": 3,
"createdAt": 1467264137000,
"id": 748386151556386818,
"text": "@davidsimpson227 Very Good Morning David",
"source": "<a href=\"http://www.valuefirst.com\" rel=\"nofollow\">ValueFirstInsu</a>",
"inReplyToStatusId": -1,
"inReplyToUserId": 570573922,
"favoriteCount": 0,
"inReplyToScreenName": "davidsimpson227",
"geoLocation": null,
"place": null,
"retweetCount": 0,
"lang": "en",
"retweetedStatus": null,
"userMentionEntities": [
{
"start": 0,
"end": 16,
"name": "David Simpson",
"screenName": "davidsimpson227",
"id": 570573922,
"text": "davidsimpson227"
}
],
"hashtagEntities": [],
"mediaEntities": [],
"extendedMediaEntities": [],
"symbolEntities": [],
"currentUserRetweetId": -1,
"scopes": null,
"user": {
"rateLimitStatus": null,
"accessLevel": 0,
"id": 2905117489,
"name": "Value First Insuranc",
"screenName": "Value1stConnect",
"location": "",
"description": "",
"descriptionURLEntities": [],
"url": null,
"followersCount": 3,
"status": null,
"profileBackgroundColor": "C0DEED",
"profileTextColor": "333333",
"profileLinkColor": "0084B4",
"profileSidebarFillColor": "DDEEF6",
"profileSidebarBorderColor": "C0DEED",
"profileUseBackgroundImage": true,
"showAllInlineMedia": false,
"friendsCount": 2,
"createdAt": 1416484627000,
"favouritesCount": 0,
"utcOffset": -25200,
"timeZone": "Pacific Time (US & Canada)",
"profileBackgroundImageUrlHttps": "https://abs.twimg.com/images/themes/theme1/bg.png",
"profileBackgroundTiled": false,
"lang": "en",
"statusesCount": 38,
"translator": false,
"listedCount": 0,
"withheldInCountries": null,
"protected": false,
"defaultProfile": true,
"geoEnabled": false,
"verified": false,
"urlentity": {
"start": 0,
"end": 0,
"url": "",
"expandedURL": "",
"displayURL": "",
"text": ""
},
"contributorsEnabled": false,
"profileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
"biggerProfileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1_bigger.png",
"miniProfileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1_mini.png",
"profileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
"defaultProfileImage": true,
"profileBannerURL": null,
"profileBannerIPadURL": null,
"followRequestSent": false,
"originalProfileImageURL": "http://abs.twimg.com/sticky/default_profile_images/default_profile_1.png",
"biggerProfileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1_bigger.png",
"miniProfileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1_mini.png",
"originalProfileImageURLHttps": "https://abs.twimg.com/sticky/default_profile_images/default_profile_1.png",
"profileBackgroundImageURL": "http://abs.twimg.com/images/themes/theme1/bg.png",
"profileBannerRetinaURL": null,
"profileBannerIPadRetinaURL": null,
"profileBannerMobileURL": null,
"profileBannerMobileRetinaURL": null
},
"withheldInCountries": null,
"quotedStatus": null,
"quotedStatusId": -1,
"contributors": [],
"possiblySensitive": false,
"retweet": false,
"retweeted": false,
"favorited": false,
"truncated": false,
"urlentities": [],
"retweetedByMe": false
}
I hope this is will help you guys figure it out what mistake I am making, In the meanwhile, I am trying on my side, if got anything will share it with you.