Automation from public HTTPS
We need to import inventory data from a URL:
https://mywebsite.com/amfeed/feed/download?id=10&file=mywebsite_inventory_feeds.csv
The automation does downloads the file, but it fails, I believe, because we do not define connection: payload.
Questions:
1. And how to set up the connection:payload?
2. Can you give us a working example of what we else we need apart from the payload?
See attachment for the error message and the file structure.
See also, the full code:
"connection":{
"type":"http",
"method":GET,
"address":"mywebsite.com/amfeed/feed/download?id=10&file=mywebsite_inventory_feeds.csv",
"paginate":1
}
"file_configs":
[{
"name":"mywebsite_inventory_feeds.csv",
"identifier":"guid",
"identifier_prefix_vendor":"FTNJ",
"search":"guid:FTNJ",
"diff_update": 1,
"diff_fields":["stock"],
"field_map":{
"guid":"Sku",
"stock":"Stock Qty"
},
"field_run":{
"Sku":"Sku",
"Stock Qty":"Stock Qty"
},
"field_format":{
"guid":{
"combine":{
"fields":[
"Sku",
""
],
"delimiter":""
}
}
},
"stock_field":"stock",
"stock_negative":false,
"update":"edit"
}]
Hey Erno, after investigating this, we determined it was related to a bug with certain paginated requests in Automation Engine. This bug should now be fixed and you should see this automation behave as expected, with no configuration changes needed on your end!
2 people like this
this does work now , I had to delete the "paginate":1 thought
Hey Erno,
Looking at the logs for this automation run, it looks like the response is HTML, as opposed to the CSV file you're expecting.
You can verify the response by using an API Tester (such as Postman) to send the GET request to that address and you can see the raw response.
Pasting the URL into a browser, it seems to show a login page first, so you may be able to use connection.login_address, connection.username, connection.password in order to pass in the proper credentials, which will allow the automation to log into the site before sending a follow-up request to download the file.
Let us know if this works, and if you have any further issues!
Hi,
I changed the connection to, but I can not tell if the file is read/generated.
What I can see in the logs is that the guid can not be generated, even-though when I read the file from a regular FTP with the same "file_configs", it creates the guid just fine....
Anyway see below my latest try ( does not work....). Please take a look at this and let me know if you can work out a working example for me. Regards
"connection":{
"type":"http",
"login_address":"https://b2b.holley.com",
"username":"my user name",
"password":"my password",
"method":"GET",
"address":"b2b.holley.com/data/atp/?api_key=my_apikey",
"pagination":{
"page_iterator":25000,
"page_parameter":"page"
}
}
Hey Erno,
A few observations to debug this:
So with all that said, let's give it another shot! Try this connection config:
"connection": {
"type":"http",
"method":"GET",
"address":"https://b2b.holley.com/data/atp/?api_key=your_apikey"
}
Let us know if it works!
Hey Erno,
Looking at your config, I see the following:
"connection":{
"type":"http",
"method":"GET",
"address":"b2b.holley.com/data/atp/?api_key=your_api_key"
},
Try changing the address to "https://b2b.holley.com/data/atp/?api_key=your_apikey" (note the addition of https://) and try running the automation again -- it's likely that hitting the URI without the https:// prefix could cause an error in the response