Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTful API support #51

Open
LuisJIA opened this issue Dec 20, 2018 · 1 comment
Open

RESTful API support #51

LuisJIA opened this issue Dec 20, 2018 · 1 comment

Comments

@LuisJIA
Copy link

LuisJIA commented Dec 20, 2018

I need to retrieve a JSON document from a RESTful API as a file. I then need to translate the document and make it a new JSON file. I then need to post it to another RESTful API.

At the moment I use bots to make XML documents from EDI X12 documents. Then a external receiver picks up the XML documents to import to another system.

I was hoping to use bots for API document movements. Any hints of how to add this feature? thanks.

@hgooijen
Copy link

Then you have to create a communicationscript for a http(s) channel.

I added a incoming and outgoing communicationscript as reference. depenging on what api you're using the "outResponse" valua van be different. For example, if the api uses headers you can change it to:

                headers = {'Content-Type':'application/json','Accept':'application/json'}
                outResponse = self.session.post(URLremotefile, headers=headers, data=content)

You can also use 2 post requests, one to first pick up a API-token, which can be used in the second post request to send/receive the data.

If you're sending something to an API (outgoing communicationscript) and want to process it's response, look into "ta_resp". there you can set the message parameters. Then add an extra route sequence and proces that message as you would like.

Good luck :)

API_Incoming_Communicationscript.txt
API_Outgoing_Communicationscript.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants