I'm developing a web application that sends requests to an FME server to run some pre-defined workspaces.
I'm passing in some parameters (including geometries as GeoJSON) as published Parameters, and I am using the rest API endpoint /fmerest/v2/transformations/commands/submit/REPOSITORY/WORKSPACE
This seems to work fine, I get a job ID back and the logs tells me that the job has run.
However, and here lies the problem: As these jobs can be long-running and I don't want the hassle of polling FME server from my web app I would like FME server to send the result as an email to an email-address specified when the job is submitted (IE: not hard-coded in FME server)
After some googling and chats with our FME experts it seems like this should be possible using the JobSubmitter service (http://docs.safe.com/fme/2014/html/FME_Server_Documentation/Default.htm#web_services/job_submitter_service.htm) and setting the opt_requesteremail property.
However: to my understanding the jobsubmitter only works with Query parameters, and not a POST body like in the /fmerest/v2/transformations/commands/submit/REPOSITORY/WORKSPACE endpoint. I want to use a POST body as I'm rather sure that I will have published parameters (GeoJSON polygons f.ex) that exeeds the maximum URL length)
So: the simple question is: How do I use the fmerest/v2/transformations/commands/submit/REPOSITORY/WORKSPACE endpoint and specify an email to send the result to?
I've tried setting NMDirectives.successTopics and NMDirectives.failureTopics to JOBSUBMITTER_ASYNC_JOB_SUCCESS and JOBSUBMITTER_ASYNC_JOB_FAILURE in the PostBody and adding opt_requesteremail and opt_servicemode=async to the URL, but it does not seem to work.
This seems to me like a rather basic question, and I cannot possibly be the first who wants to do this? Any help appreciated!