Closed acupoftee closed 5 years ago
If I’m reading the documentation correctly, you should attach the non-shortened status url as attachment_url
:
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 Tweet text length 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.
See here https://developer.twitter.com/en/docs/tweets/tweet-updates
Thank you @jeremylow. The full status URL worked.
I am getting the same error and I used the line
url= "https://www.google.com"
twitter.error.TwitterError: [{'code': 44, 'message': 'attachment_url parameter is invalid.'}]
I have tried many other urls and they all fail with the save error. Can anyone give me a url that actually works?
I am trying to use
PostUpdate(text, attachment_url)
method in order to share a quoted tweet by using Twitter's shortened URLhttps://t.co/
followed by a status ID. Here's my code below:api.PostUpdate(hashtags, attachment_url="https://t.co/AbcDe13gg")
Here is the traceback below:
I've also tried using escape characters in case that was the issue and it still raised the error. What is considered a bad URL? Thank you for your time