0

CANNOT post image via meme api ?

why i cannot post image to meme via the api, i copy the example query from the api specification and test it with yql console but return something like this :
The INSERT query refers to invalid id(s) 'caption'. A valid id can either be a key, value or a map

this query looks like this :
INSERT INTO meme.user.posts (type, content, caption) VALUES ("photo", "http://www.yahoo.com/myphoto.jpg", "this is the photo caption posted from YQL")

by
8 Replies
  • QUOTE (Oscar @ Oct 16 2009, 03:19 AM) <{POST_SNAPBACK}>
    why i cannot post image to meme via the api, i copy the example query from the api specification and test it with yql console but return something like this :
    The INSERT query refers to invalid id(s) 'caption'. A valid id can either be a key, value or a map


    Hi Oscar,

    we will rename the field "comment" to "caption" - that should be online in a few days. For now, you can use "comment" instead of "caption" (we'll support both for some time, before removing "comment").

    Ex.: INSERT INTO meme.user.posts (type, content, comment) VALUES ("photo", "http://www.yahoo.com/myphoto.jpg", "this is the photo caption posted from YQL")


    Regards,
    Bruno
    0
  • QUOTE (Bruno @ Oct 20 2009, 01:12 PM) <{POST_SNAPBACK}>
    Ex.: INSERT INTO meme.user.posts (type, content, comment) VALUES ("photo", "http://www.yahoo.com/myphoto.jpg", "this is the photo caption posted from YQL")


    hello

    I have tried this YQL command with caption and comment without success; I get response NULL
    $response = $app->query($yql);
    I have no problem with other yql commands like SELECT * FROM meme.following, but I can't post text , photo, audio . What I am doing wrong? Thanks for your help
    0
  • QUOTE (Jordi @ Oct 21 2009, 12:24 AM) <{POST_SNAPBACK}>
    hello

    I have tried this YQL command with caption and comment without success; I get response NULL
    $response = $app->query($yql);
    I have no problem with other yql commands like SELECT * FROM meme.following, but I can't post text , photo, audio . What I am doing wrong? Thanks for your help


    Hi,

    INSERT/UPDATE/DELETE are handled differently in YQL. I'm almost sure this method (query) uses GET to perform the request, and YQL solely rejects it when it is not a SELECT statement. For that case you should use either POST,PUT,DELETE or JSONP-X. Probably you will need to make the request yourself using curl, but I'll double check this.

    Regards,
    ~dsouza
    0
  • In the doc we have $response = $session->query($query); but the response is NULL! I get the session but I can't post text. Who knows how to do this?
    0
  • still same problem even after 2 months

    $query='INSERT INTO meme.user.posts (type, content) VALUES ("text", "Posting via my app")';

    $user->execute($query);

    this Does not work.....!

    Even
    $queryResponse = $session->query($query);
    Does not work

    i changed method to POST, PUT but no result.

    please help us

    is yql dont support insert command?
    0
  • is yql dont support insert command? if not then what is correct solution..
    0
  • Hi,

    the current SDK available for yql does not support INSERT/UPDATE/DELETE commands. The support for this is already being implemented and should be released soon. The problem is that the current SDK uses HTTP GET method for all statements and yql demands either POST,PUT,DELETE (you may actually use GET if you perform JSON-P request, which is really appending a `callback' parameter to the request.).

    In the meantime, while the API is not available, the only solution is to implement this by yourself, which is a bit trick as you would need to compute oauth signature correctly. Other than that it should be relatively simple to get this working.

    Let me know your findings about this.

    Regards,
    ~dsouza

    QUOTE (Testing @ Feb 3 2010, 02:43 AM) <{POST_SNAPBACK}>
    is yql dont support insert command? if not then what is correct solution..
    0
  • Hi dsouza,

    Any work around for this?
    0
  • Here's a workaround to get insert capabilities working via the PHP SDK provided for YAP. As mentioned above a GET request with JSON-P (JSON with callback) will work on the system. To modify the SDK to allow this functionality, you can do the following:

    In the Yahoo.inc file on like 789 is the following line:
    $params = array('q' => $yql, 'format' => 'json', 'env' => 'http://datatables.org/alltables.env');

    Switch this to JSON-P functionality by adding a callback like so:
    $params = array('q' => $yql, 'format' => 'json', 'callback' => 'runCallback', 'env' => 'http://datatables.org/alltables.env');

    Then define in JavaScript the following function (should be in the same file that you're calling the query method):
    <script type="text/javascript">
    function runCallback(obj){
    console.log('callback called' + obj);
    }

    That should give you the GET request with callback, making the query method be a JSON-P request. This also means that all YQL queries will now go through that callback.

    Hope that helps,

    Jonathan LeBlanc
    Technology Evangelist
    Yahoo! Developer Network
    Twitter: @jcleblanc
    0
This forum is locked.

Recent Posts

in Meme-General discussion