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

media-upload
api
extended-tweet
urls

#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.


#21

That URL is NOT valid for use in that parameter.

In order for a URL to not be counted in the body of the Tweet, a new attachment_url parameter will be available on statuses/update to allow a client to attach it to the Tweet without explicitly adding it to the Tweet text. This URL must be a Tweet permalink, or DM deep link. Arbitrary, non-Twitter URLs should remain in the Tweet text and will count against the 140 character limit. URLs passed to the attachment_url parameter not matching either a Tweet permalink or DM deep link will fail at Tweet creation and cause an exception.


#22

attachment_url parameter is not displaying any post in the tweet whatever the URL might be.
help me in suggesting that to post URL against 140 characters.

can you povide me the sample URL which is supported by twitter.
I have passed the permalink link too like below:

var params = { status: '@sivasai filter streams to find your target ', attachment_url: 'http://www.cscinco.com/event?e=58589bfc4f2fe526d999f8a1&u=5858bc8c4f2fe526d999f91c '} 

and DM deep link like below in the attachment_url parameter still unable to get any post in the tweet.

 var params = { status: '@LEADoid filter streams to find your target audience and then engage them within their own social post', attachment_url: 'https://leadoid.com/#!/home', media_ids: [mediaIdStr] }

#23
T.post('statuses/update',{status: 'filter streams to find your target-http://www.cscinco.com/event?e=58589bfc4f2fe526d999f8a1&u=5858bc8c4f2fe526d999f91c'}, function(error, data, response){
  if(error){
    console.log(error);
  }
  console.log(data);  
  console.log(response);  
});
var params = { status: '@sivasai filter streams to find your target ', attachment_url: "http://www.cscinco.com/event?e=58589bfc4f2fe526d999f8a1&u=5858bc8c4f2fe526d999f91c" }
T.post('statuses/update', params, function(error, data, response){
  if(error){
    console.log(error);
  }
  console.log(data);  
  console.log(response);  
});

when I am executing the code-1 I am able to get the output post in the tweet. the URL is working with in 140
When I am executing the code-2 I am unable to see the post in the tweet not working against 140?


#24

Yes, because that URL is NOT valid to as a value in the attachment_url parameter, as I’ve told you at least 4 times already in this thread. Please stop repeatedly asking for help on this. This behaviour is exactly as expected and as designed and will not change.

Non-Twitter URLs will not work in that parameter.


#25