Skip to main content
Question

FME Server Rest API Python Data Upload/Download

  • January 24, 2019
  • 5 replies
  • 169 views

cwarren
Forum|alt.badge.img

I am still learning FME Server's REST API and was wondering if it is possible to use python to upload a file to FME Server to be processed and receive the data download file? I am going through the REST API training and working with code that is available on the developer playground,[https://playground.fmeserver.com/python-request/] but could use some guidance on how to properly upload a file to FME Server to run the workspace and retrieve the download. For my test purposes, I'm just using txt files. I would like to upload a text file, then retrieve the output text file data download zip. I'm not familiar with Javascript, so I was wanting to integrate this into my Python application.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

david_r
Celebrity
  • January 25, 2019

Yes, it's definitely possible.

There are some sample applications that showcases this on the FME Server Playground, e.g.

https://playground.fmeserver.com/javascript/server-uploads/upload-file-in-session/


cwarren
Forum|alt.badge.img
  • Author
  • January 25, 2019

Yes, it's definitely possible.

There are some sample applications that showcases this on the FME Server Playground, e.g.

https://playground.fmeserver.com/javascript/server-uploads/upload-file-in-session/

Hi @david_r, I've looked at the javascript examples in the playground and was just curious if this was possible with python. I have successfully ran a workspace with python (using the python template code from the developer playground), but I'm looking at a way to upload/download with python.


david_r
Celebrity
  • January 25, 2019

Hi @david_r, I've looked at the javascript examples in the playground and was just curious if this was possible with python. I have successfully ran a workspace with python (using the python template code from the developer playground), but I'm looking at a way to upload/download with python.

Yes, it's definitely possible with Python as well. I would recommend using the excellent requests module, it makes things a lot easier than the standard library.

@guy_lafleur has also published Python code on github that implements parts of the REST API in Python, which can be either used as-is or as inspiration for creating something on your own:

https://knowledge.safe.com/questions/81237/python-fme-server-rest-api-wrapper.html

 


cwarren
Forum|alt.badge.img
  • Author
  • January 25, 2019

Yes, it's definitely possible with Python as well. I would recommend using the excellent requests module, it makes things a lot easier than the standard library.

@guy_lafleur has also published Python code on github that implements parts of the REST API in Python, which can be either used as-is or as inspiration for creating something on your own:

https://knowledge.safe.com/questions/81237/python-fme-server-rest-api-wrapper.html

 

Thanks @david_r, I will look into that.


xtian79
Contributor
Forum|alt.badge.img+6
  • Contributor
  • September 23, 2019

In the current version of FME Server you can use:

POST /repositories/< repository >/items/< item >/resources