Expand my Community achievements bar.

Don’t miss the Workfront AMA: System Smarts & Strategic Starts! Ask your questions about keeping Workfront running smoothly, planning enhancements, reporting, or adoption, and get practical insights from Adobe experts.
SOLVED

Sending JSON to the search API action instead of query strings

Avatar

Level 4

Hi All,

I have a Workfront Search module in Fusion that searches for projects that

  • are in portfolio X
  • and were entered by user A or user B
  • and don't have status X or Y or Z
  • and have the External Ref ID field populated

tibormolnar_1-1759838192940.png

I would like to achieve the same using the Workfront Custom API Call module. So I tried to "translate" the filters into query string parameters.

I finally managed to figure out how to do the in/notin [array] filters as query strings, and the following is working:

/proj/search?
portfolioID=6697fa04001c019abca6425f837bb477
&portfolioID_Mod=eq
&extRefID_Mod=notnull
&status=CUR
&status=CPL
&status=QUE
&status=DED
&status_Mod=notin
&enteredByID=6335d882006d9628cc525e59fce818a7
&enteredByID=63d38d74000599f6ac8f5b3656e6cb56
&enteredByID_Mod=in

(Line breaks are added here only for easier reading.)

Admittedly this is a bit cumbersome. So I am checking if there's an easier way.

 

When I check the DevTool -> Live Stream in Fusion, I can see that for request produced by the Workfront Search module, the Query String appears to be a JSON block:

tibormolnar_2-1759840711890.png

Does it mean that somehow a complete JSON block can be sent to the /project/search endpoint? (If yes, how?)

Or it means only that what Live Stream displays as "Query String" is actually not the query string sent to the API, only what Fusion uses to generate the query string?

I appreciate any toughts.

Tibor

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hello Tibor,

 

You can use the Filter paremeter to pass JSON as explained here.

 

Your call would look like this:

/PROJ/search?filters={"status":["CUR","CPL","QUE","DED"],"status_Mod":"notin","extRefID_Mod":"notnull","enteredByID":["<id>","<id>"],"enteredByID_Mod":"in"}

 

 

Regards

Lars

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hello Tibor,

 

You can use the Filter paremeter to pass JSON as explained here.

 

Your call would look like this:

/PROJ/search?filters={"status":["CUR","CPL","QUE","DED"],"status_Mod":"notin","extRefID_Mod":"notnull","enteredByID":["<id>","<id>"],"enteredByID_Mod":"in"}

 

 

Regards

Lars

Avatar

Level 4

Hello Lars,

thank you, that's exactly what I needed - it works like a charm.

Also, thanks for pointing me to the documentation. I should have been able to find that myself.

Tibor