issue of response of PodioItemDiff::revert . It did not work well anymore .

Comments

4 comments

  • 杜晓闻

    By my analyse, the podio.com's "revert this revision" function is implemented by calling a delete method, and its url is:"https://podio.com/_json/items/162690513/revisions/8", but I checked the PodioItemDiff::revert api in PodioItemDiff.php, its url is:"/item/{$item_id}/revision/{$revision_id}", so I think the url could be wrong, so I changed it to "/_json/items/{$item_id}/revisions/{$revision_id}", but I got error:
    [2014-06-04 13:24:25] production.ERROR: PodioNotFoundError: "No matching operation could be found. The path '/_json/items/162690513/revisions/2' was not found.."
    Request URL: http://api.podio.com/_json/items/162690513/revisions/2

    Stack Trace:
    #0 E:\tools\Player\StudyMan\Web\Eclipse\workspace\zy\Depend\lib\Podio.php(321): Podio::request('DELETE', '/_json/items/16...', Array)
    #1 E:\tools\Player\StudyMan\Web\Eclipse\workspace\zy\Depend\models\PodioItemDiff.php(22): Podio::delete('/_json/items/16...')

    What should I do to make a revision revert?

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    URLs that are not on api.podio.com are for internal use and you won't be able to use them. I just closed a pull request that I believe will fix your issue. Details at: https://github.com/podio/podio-php/pull/52

    0
    Comment actions Permalink
  • 杜晓闻

    Thanks for your support . We tested the API ,but we can revert sucessfully occasionally, and fail sometimes, I don't know why. All Items I revert by workspace admin role are also created by workspace admin, and When success, I get a response of 200, when I fail, I get a response of 204 .
    I would like to know when the revert api will successfully revert item ? or what the precondition to revert a revision is ?

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    Hi,

    You will get a 204 response when you try to revert to a revision that's identical to the current revision (i.e. no new revision id is being generated because it's not needed).

    /Andreas

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk