I cant send updates that beging with @ through API 1.1


#1

Hello!

I can´t send updates that begin with @ (mentions) using https://api.twitter.com/1.1/statuses/update.json through my php application. If the tweet begin with other character it works, but if it begin with @ it doesn´t work and twitter doesn’t return any error.

I have “Read, Write and Access direct messages” permision in my application.

What I’m doing wrong? or How can I send mentions through API 1.1?

Thank you!


#2

Make sure you’re encoding the “@” character (and reserved characters, really) correctly. API v1.1 is strict about correct HTTP and OAuth and the “@” character must be represented as “%40”


#3

Hi @episod

Thank you for your answer.
I think I’m doing the encoding right. Because if I tweet this “Hi @episod” with my application, it works. But if I tweet this “@episod Hi” it doesn´t work.


#4

When I said that it doesn´t work it means that my app don´t receive any answer not even an error.

I don´t know if I have to include some more information when I send the mention of it cant be send by https://api.twitter.com/1.1/statuses/update.json

Thank you!


#5

Can you share a bit more on how you formulate the request?

What, if any, library are you using?


#6

I’m using this library http://github.com/j7mbo/twitter-api-php

This is a simple example of how I’m using the library:

$url = ‘https://api.twitter.com/1.1/statuses/update.json’;
$text = ‘@episod Hi’;
$requestMethod = ‘POST’;
$postfields = array(‘status’ => $text);
$twitter = new Model_TwitterAPIExchange($this->conf());

$resultado = $twitter->buildOauth($url, $requestMethod)
->setPostfields($postfields)
->performRequest();

$resultado = json_decode($resultado);

Thank you very much for your answers!


#7

By the way… My php file is encoded in UTF8.


#8

Hi!

There is something wrong with the library I’m using? Or I’m doing something wrong in my request?

There is another way to make the request?

Thank you!