Page 1 of 1

Web Services API

Posted: Thu Jun 06, 2019 7:11 pm
by mvahidi
Hello everyone,

My team and I want to use the Switch Web Services API to submit a job to a Switch Client Submit Point. However, one of the parameters of the http call is PATH and you have to specify where the call needs to get the file from in your internal (local) machine.

We were looking to tell the Switch Client to get our desired jobs/files from a url (online external address) rather than a local repository (folder). Is this possible in any way?

Or, is there a way for us to feed jobs into switch by telling switch to download our jobs from an online url?

If anybody could point me to the right direction or people that can help me with this, I'd highly appreciate it.

Thank you,
Mostafa Vahidi

Re: Web Services API

Posted: Tue Jun 11, 2019 2:26 pm
by freddyp
Submitting a file to a submit point obviously requires a file. What you want to submit is not data, but metadata! You can easily do this by putting the URL in some XML structure and submit that XML file into the flow. The first thing you do in the flow is "XML pickup - Metadata is asset", so the submitted file becomes a dataset, followed by "HTTP request" in which you get the URL from the metadata, and the real file will be available in the flow.

Re: Web Services API

Posted: Tue Jun 11, 2019 2:34 pm
by jan_suhr
Switch 2019 let you use a submit point without any file, it will generate a XML-file from the form fields in the submit point.

Re: Web Services API

Posted: Tue Jun 11, 2019 4:25 pm
by freddyp
Indeed, Jan, the new 2019 submit point functionality allows to submit only metadata, but behind the scenes there is still a file. As Mostafa plans to integrate an external system into Switch using the REST API he will not be using Switch Client, but he will still have to create a file too.

To expand on my previous reply: instead of creating an XML and submitting it, it is also possible to create a dummy file and provide the metadata fields as key/value pairs using the Upload part of the REST API. I suggested submitting an XML and doing a pickup on that XML because I think it is a bit easier to implement, but "easier to implement" is a relative concept of course. Both approaches are possible, everybody can choose his or her preferred method.

One thing is key, however: the URL that points to the real file that has to be downloaded must be considered as metadata, not as data.