Prefix(@username) and Suffix(DM Deep links) are supporting excluding 140 characters?

media-upload
api
extended-tweet
urls

#1

Hi,
I am wondering that the changes made by the Twitter prefix(@username) and suffix(URL-DM deep link) are working now with 140 characters?
I can able to do image upload along with 140 characters.but not prefix and suffix.Is it available or still implementing?
https://yourstory.com/2016/09/twitter-character-limit-live/
In the above link they mentions prefix is not live yet. Whether it is rolled out now?
If implemented please provide me the sufficient API documentation.

Thanks in advance.


Doing more with 140 characters with DM Deep link
Not working: attachment_url Properly
#2

The changes to replies have not yet been rolled out.

All of the changes are documented here:
https://dev.twitter.com/overview/api/upcoming-changes-to-tweets


#3

I need to add the URL(DM deep link) along with 140 characters Is it possible.
I can able to do only 2 changes:
a) Adding image,GIF along with 140 characters.
b) Quote tweet excluding 140 charcters.

I am unable to add prefix and suffix(URL) along with 140 characters.As your comment prefix is not rolled out yet. What about URL(DM deep links) we can do along with 140.unable to add URL along with 140.IF it is possible send be the API used documentation.


#4

The page I linked to above contains the documentation - use the attachment_url parameter to add the DM
deep link.


#5

But I dont find any sufficient documentation(API) in which attachment_url parameter need to be attached for DM deep links. Can you provide me the sufficient API for Attachment_url.
When I add attachement_url in media/upload and statuses/update getting error:{ errors: [ { code: 44, message: ‘attachment_url parameter is invalid.’ } ] }


#6

What value are you passing? It only applies on statuses/update. You cannot have a direct message link and media attached to the same status.


#7

Here’s an example using twurl

$ twurl -d "status=contact... &attachment_url=https://twitter.com/messages/compose?recipient_id=54931584" "/1.1/statuses/update.json"

You obviously need to insert a valid recipient ID (i.e. matching your own user ID), and to have “Receive DMs from anyone” enabled in your user settings, for this to work.


#8
var b64content = fs.readFileSync('/home/sivasaivarma/Day Users/sivasaivarma/personal/bigdata/images/leadoid.jpg', { encoding: 'base64' })
T.post('media/upload', { media_data: b64content}, function (err, data, response) {
 var mediaIdStr = data.media_id_string
  var altText = "Small flowers in a planter on a sunny balcony, blossoming."
  var meta_params = { media_id: mediaIdStr, alt_text: { text: altText } }
   T.post('media/metadata/create', meta_params, function (err, data, response) {
   if (!err) {
      
     var params = { status: '@sivasai Nepal diverse and beautiful landscape with these adventure photos new to nepal came here for outing to see. on.natgeo.com/2dYabpI', media_ids: [mediaIdStr] }

      T.post('statuses/update', params, function (err, data, response) {
        console.log(data)
      })
    }
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																									  })
})



 
  var params = { status: 'LEADoid', attachment_url: 'http://bit.ly/2kJaDc1'}

      T.post('statuses/update', params, function (err, data, response) {
        console.log(data)
      })
    })

#9

I am able to add image aganist 140 characters. but at the same time if i am adding attachment_url with statuses/update it is showing error.I dont find any attachment_url parameter in statuses/update in the documentation you sent.I am working on nodejs with Twit API


#10

That is not a valid attachment url. It must be a Twitter direct message deep link. You cannot attach arbitrary URLs in this manner. Also, you cannot attach an image to a Tweet and include a DM deep link at the same time.

Your second code block does not make sense as you are not uploading any media but you’re trying to update a status inside the upload callback.

I’ve provided an example and a link to the documentation so I think this is all we can do to help at the moment.


#11
var b64content = fs.readFileSync('/home/sivasaivarma/Day Users/sivasaivarma/personal/bigdata/images/leadoid.jpg', { encoding: 'base64' })
T.post('media/upload', { media_data: b64content}, function (err, data, response) {
 var mediaIdStr = data.media_id_string
  var altText = "Small flowers in a planter on a sunny balcony, blossoming."
  var meta_params = { media_id: mediaIdStr, alt_text: { text: altText } }
   T.post('media/metadata/create', meta_params, function (err, data, response) {
   if (!err) {
      
     var params = { status: '@sivasai Nepal diverse and beautiful landscape with these adventure photos new to nepal came here for outing to see. on.natgeo.com/2dYabpI', media_ids: [mediaIdStr], attachment_url: 'https://leadoid.leadoid.com/#!/lead/landingpage/56f93a04a084d542152d6f63/589c70ccb4c4263b0b498e19/55b9cb83cd965bf950fbf386' }

      T.post('statuses/update', params, function (err, data, response) {
        console.log(data)
      })
    }
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																									  })
})

#12

You cannot attach images and also use an attachment URL.
You cannot pass arbitrary URLs in the attachment URL parameter. This is clearly stated in the documentation.


#13
var params = { status: '@sivasai Nepal diverse and beautiful landscape with these adventure photos new to nepal came here for outing to see filter streams to find', attachment_url: 'https://t.co/VbmGKY9' }
T.post('statuses/update', params, function(error, data, response){
  if(error){
    console.log(error);
  }
  console.log(data);  
  console.log(response);  
});

#14

Hi @andypiper Thank you, attachment_url is working under statuses/update without any errors but i am not getting any tweet in the twitter post. Any Reason.


#15

There are some issues with the attachment_url. unable to post the tweet using attachment_url.Is there any alternative to add url aganist 140 characters.By adding attachment_url i am able to run but the tweet is not posting on the tweet.


#16

What URL are you attempting to add?


#17

https://leadoid.leadoid.com/#!/lead/landingpage/56f93a04a084d542152d6f63/589c70ccb4c4263b0b498e19/55b9cb83cd965bf950fbf386
when i added above link it is showing error. for sample i have attached below url still not getting output
https://t.co/VbmGKY9

if those are wrong send me the example URL which supports twitter.


#18
var params = { status: '@sivasai Nepal diverse and beautiful landscape with these adventure photos new to nepal came here for outing to see. ', attachment_url: 'https://t.co/VbmGKY9'}
T.post('statuses/update', params, function(error, data, response){
  if(error){
    console.log(error);
  }
  console.log(data);  
  console.log(response);  
});

i added below link attachment url too but still not working.
https://leadoid.com/#!/home

I am having bitly links will it not be accepted?
http://bit.ly/2kJaDc1 i am passing this as attachment_url so I need to pass this URL in the twitter post.


#19

The documentation and all of my previous answers are extremely clear on this. You cannot add arbitrary URLs via attachment_url.

A URL at the end of Tweets generated from attaching photos, a video, GIF, poll, Quote Tweet, or DM deep link will also not count towards the character limit (URLs typed or pasted inside the Tweet will be counted towards the character limit as they do today).


#20
var Twit = require('twit');
var fs = require('fs');

var T = new Twit({
   consumer_key: ''
  , consumer_secret:      '' 
  , access_token:         '' 
  , access_token_secret:  ''
});


var params = { status: '@sivasai Nepal diverse and beautiful landscape with these adventure photos new to nepal came here for outing to see filter streams to find', attachment_url: 'http://www.liveworld.com/'}
T.post('statuses/update', params, function(error, data, response){
  if(error){
    console.log(error);
  }
  console.log(data);  
  console.log(response);  
});

Is this is right declaration. after executing this code i am unable to get any post in the tweet.how ever the url may be. I am wondering that when ever attachment_url parameter is used it is executing without any eroor but not displays any output.