-1

I am trying to return the diffence in field values between two revisions using app authentication but I'm getting an empty array. And when trying to use the api function "Get Item revision" I'm getting "Object not found" response.

Any help would be much appreciated :)

const podio = new Podio({
authType: 'app',
clientId: clientId,
clientSecret: clientSecret });
podio.authenticateWithApp(app_id, appToken, (err) => {
if (err) throw new Error(err);

podio.isAuthenticated().then(function () {
// ready to make API calls

apiRoutes.get('/item', function (req, res) {
  podio.request('GET', `/item/702620400/revision/1899410196/1910867632`).then(function (responseData) {
      res.json(responseData);
    });
  });


}).catch(err => res.send(err));
});
  • Any code samples with exact requests/responses? – Pavlo - Podio Oct 30 '17 at 14:27
  • @Pavlo-Podio I have included the code, the response from making this call is '[ ]', I'ts worth mentioning that I have also tried the sandbox environment and I get the same response. Thank you for your help – Cristian-Florin Pandele Oct 30 '17 at 15:22
  • Can you also share results from https://developers.podio.com/doc/items/get-item-revision-22373 call for both revisions in question? (1899410196 and 1910867632) ? You might have 2 changes to same field which gives exactly same result so revision diff is empty. E.g. category field changed from 'Open' to 'Closed' and then changed again from 'Closed' to 'Open'. Revision diff will be empty then. – Pavlo - Podio Oct 30 '17 at 17:12
  • The field I was modifying had a numeric value which I only incremented, I have made more changes to my item and it seems it can give me the difference between 2 revisions now. And when I'm trying to call the API with "GET /item/{item_id}/revision/{revision}" it still returns "Object not found" – Cristian-Florin Pandele Oct 31 '17 at 08:29
  • Apparently whenever I modify a "category" I can see the changes between the 2 revisions, but if I only modify a "number" I won't be able to. – Cristian-Florin Pandele Oct 31 '17 at 08:35

1 Answers1

0

Podio documentation is not clear enough when describes calls for item revisions. Here is how it works, example in Ruby:

  item_revisions = Podio::ItemRevision.find_all_by_item_id(item_id)
  last = item_revisions.length - 1
  revision_last = Podio::ItemRevision.find(item_id, last)
  revision_beforelast = Podio::ItemRevision.find(item_id, last - 1)
  diff = Podio::ItemDiff.find_by_item_and_revisions(item_id, last - 1, last)

Misleading part is revision_id vs revision vs item_revision_id. For "Get Item revision" and "Get item revision difference" calls please use revision which goes for each item from 0 and increases by 1 with each new revision. Last revision available for item is item_revisions.length - 1 from example above.

Pavlo - Podio
  • 2,003
  • 2
  • 10
  • 19