photools.com Community

IMatch Discussion Boards => IMatch Scripting and Apps => Topic started by: thrinn on June 30, 2017, 05:46:42 PM

Title: Question: Where do I find the documentation for "actions"?
Post by: thrinn on June 30, 2017, 05:46:42 PM
The Web Services documentation for the v1/attributes endpoint mentions:
Quoteactions: A JSON object which specifies which files to update and which Attributes to set. See separate documentation for details.

Where can I find this documentation for actions? I first thought actions would be a synonym for the Tasks object which is describes in detail on the Code Recipes page. But the Attributes Sample App uses op: "update" which is not documented for the Tasks object, so this seems to be something different.
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: Mario on June 30, 2017, 07:07:44 PM
attributes is wrong, have renamed it to tasks later. I will fix the schema parameter.

I think there is no documentation for POST /attributes yet, don't remember. If so, add a feature request. Allowed ops are add/update/delete/replace.
I thought the sample app was sufficient.
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: thrinn on June 30, 2017, 07:47:07 PM
Sorry, I am a bit confused:
Do you mean v1/attributes POST expects a parameter called tasks instead of actions? Or is it something you will change for an upcoming release?

I ask because the Attributes Sample App (2017.6.10) uses actions and works well:

// Convert data into a string to send it to IMWS
params.actions = JSON.stringify(actions);


Title: Re: Question: Where do I find the documentation for "actions"?
Post by: Mario on June 30, 2017, 08:03:54 PM
It expects tasks. See the Attributes sample app for details.
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: thrinn on June 30, 2017, 08:26:08 PM
Hm, the code sample in my last post is from the sample app (code lines 381, 455, 527). String "task" can not be found in the entire index.html.
Maybe you already changed it in your development system after the last update?
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: ubacher on June 30, 2017, 08:59:41 PM
I just posted an app which reads and writes an (image level) attribute.
Maybe the code will help you. I started with Mario's sample app (cut and paste programming).
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: thrinn on June 30, 2017, 09:42:15 PM
Thank you, ubacher. I think you are becoming the App Master of this community  ;)
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: sinus on June 30, 2017, 09:53:01 PM
Quote from: thrinn on June 30, 2017, 09:42:15 PM
Thank you, ubacher. I think you are becoming the App Master of this community  ;)

:D

both of you  8)
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: Mario on July 01, 2017, 11:53:25 AM
My guess was wrong. It's called actions not tasks for attributes. Sorry for the confusion. I should have named that tasks to make it more similar to metadata updates, but there you go. Hard to get everything right with an API so huge.

I could rename it to tasks for the next update but I don't know how many apps this will break.
Title: Re: Question: Where do I find the documentation for "actions"?
Post by: thrinn on July 01, 2017, 04:41:43 PM
Well, I think as you already enhanced the documentation with actions it would be easier to leave it at it is. In the end, it is not a big deal.