0

Single Update PUT returns 405 Method Not Allowed

- The app (id: 2Jc49t4i) is set to request read/write for Updates
- I'm logged in as the developer of the app
- I approved the permissions as the end user
- When I post the following updates call to the REST, I get a 405 back and cannot for the life of me figure out why. I have a set status call working fine.

URL:
http://social.yahooapis.com/v1/user/GAZU7C...4624a52f3ae6437

Post Data:
Content-type: application/json
Content-length: 275
{"updates":[{"collectionType":"guid","description":"Description of post","type":"appActivity","pubDate":"1265773214","collectionID":"GAZU7CAXQ6AMFJZBOSVQBT77TM","link":"http://google.com","source":"APP.2Jc49t4i","class":"app","suid":"1265773214251","title":"Title of post"}]}

Response Code:
405 Method Not Allowed

by
5 Replies
  • I've posted a very simple demo at http://apps.yahoo.com/-slzHlL7a where you can see the Set Status call works, but the Post Update does not.
    0
  • QUOTE (Robert @ Feb 9 2010, 08:39 PM) <{POST_SNAPBACK}>
    I've posted a very simple demo at http://apps.yahoo.com/-slzHlL7a where you can see the Set Status call works, but the Post Update does not.



    Can you try using the http method PUT to create a new update?
    0
  • QUOTE (Dustin Whittle @ Feb 17 2010, 06:29 AM) <{POST_SNAPBACK}>
    Can you try using the http method PUT to create a new update?


    Thanks Dustin, we are sending this from Flash so we can't do a true PUT. See http://dynamicflash.com/2008/11/the-troubl...flash-and-rest/ for an exact description of the problem (oddly enough the post is written by a Senior Yahoo! Developer from London).

    So we need Yahoo! to support X-HTTP-Method-Override and open up all the crossdomains to allow headers="*" (i.e. http://social.yahooapis.com/crossdomain.xml locks headers down to Authorization only).

    We also tried doing this via FQL but that didn't work either! I successfully ran this YQL on the test console and it created an update, but am getting a 400 Bad Request when I send the same query through the Flash SDK to the REST API.

    CODEBOX
    INSERT INTO social.updates (guid, title, description, link) VALUES (me, "Title of post", "Description of post", "http://yahoo.com")


    So when using the Flash SDK to send the request I get a 400. Here's the code I'm calling and the URL it sends across the wire:

    Code snippet that results in 400:
    _session = YahooSession.sessionFromYAP(consumerKey, consumerSecret, flashvars.yap_appid, atk, ats, guid);
    _user = _session.getSessionedUser();

    _user.yql.query('INSERT INTO social.updates (guid, title, description, link) ' +
    'VALUES (me, ' +
    '"Title of post", ' +
    '"Description of post", ' +
    '"http://yahoo.com")');

    Triggers this URL which yields a 400:
    http://query.yahooapis.com/v1/yql?format=j...uth_version=1.0

    But I can however send this FQL through the Flash SDK fine using the same code as above:
    select * from geo.places where text="san francisco, ca"

    So I'm unsure what's bad about the social.updates query since it works in the FQL test console. Any ideas? Can anyone run that yql.query() from Flash successfully?
    0
  • I cant use the insert social.updates YQL using the PHP SDK as well.

    CODE
    runCallback({"query":{"count":"1","created":"2010-03-03T08:02:38Z","lang":"en-US","updated":"2010-03-03T08:02:38Z","uri":"http://query.yahooapis.com/v1/yql?q=INSERT+INTO+social.updates+%28guid%2C+title%2C+description%2C+link%29+VALUES+%28%27A234234WBZXC55U5VLR6BPJCHMM4%27%2C+%27Perl+Thumb%27%2C+%27Test+%23perlthumb%27%2C+%27http%253A%252F%252Fxsoft.com%252Findex.php%27%29","diagnostics":{"publiclyCallable":"false","url":{"execution-time":"3","proxy":"DEFAULT","content":"http://datatables.org/alltables.env"},"user-time":"21","service-time":"7","build-version":"5275"},"results":{"status":"error"}}});


    the status is error. And I dont know what is the error. Its just error.

    Running the insert in YQL console doesnt give me an error.
    0
  • Hi Mark, in your earlier post you were correct - we will need to allow all hosts (*) within the crossdomain.xml file on our side to aid in pushing out updates. As you mentioned:

    So we need Yahoo! to support X-HTTP-Method-Override and open up all the crossdomains to allow headers="*" (i.e. http://social.yahooapis.com/crossdomain.xml locks headers down to Authorization only).

    We are currently working on this issue and the adjustment is slated for our next platform release. This should allow you to push out updates to the platform once ready. For your reference, the bug # is 2797664 if you need to refer back to it.

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

Recent Posts

in Updates