Web Services API

Post Reply
mvahidi
Newbie
Posts: 3
Joined: Thu Jun 06, 2019 7:04 pm

Web Services API

Post by mvahidi » Thu Jun 06, 2019 7:11 pm

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

freddyp
Advanced member
Posts: 451
Joined: Thu Feb 09, 2012 3:53 pm

Re: Web Services API

Post by freddyp » Tue Jun 11, 2019 2:26 pm

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.

jan_suhr
Advanced member
Posts: 247
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Web Services API

Post by jan_suhr » Tue Jun 11, 2019 2:34 pm

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.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps

freddyp
Advanced member
Posts: 451
Joined: Thu Feb 09, 2012 3:53 pm

Re: Web Services API

Post by freddyp » Tue Jun 11, 2019 4:25 pm

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.

Post Reply